Ejemplo n.º 1
0
int		main( void )
{
	int i;
	srand(time(0));

	FragTrap ft = FragTrap( );
	FragTrap ft2 = FragTrap("Kakashi-Sensei");
	FragTrap ft3 = FragTrap(ft2);

	std::cout << std::endl;

	std::cout << "Started with " << ft2.getName( ) << std::endl;
	i = 0;
	while ( i < 5 ) {
		ft2.vaulthunter_dot_exe( "Vickings" );
		std::cout << std::endl;
		i++;
	}

	std::cout << std::endl;
	std::cout << std::endl;

	ScavTrap st = ScavTrap( );
	ScavTrap st2 = ScavTrap("CL4P-TP");
	ScavTrap st3 = ScavTrap(st2);

	std::cout << std::endl;

	std::cout << "Started with " << st2.getName( ) << std::endl;
	i = 0;
	while ( i < 3 ) {
		st2.challengeNewcomer("pourquoi stp");
		std::cout << std::endl;
		i++;
	}

	std::cout << std::endl;
	std::cout << std::endl;

	ClapTrap ct = ClapTrap("SIMPLE");

	NinjaTrap nt = NinjaTrap("Naruto-san");
	NinjaTrap nt2 = NinjaTrap("Sasuke-san");

	std::cout << std::endl;

	std::cout << "start with the ninja : " << st.getName( ) << std::endl;

	nt.ninjaShoebox( ct );
	nt.ninjaShoebox( nt2 );
	nt.ninjaShoebox( ft2 );
	nt.ninjaShoebox( st2 );

	std::cout << std::endl;
	std::cout << std::endl;

	return 0;
}
Ejemplo n.º 2
0
int main(int ac, char **av)
{
	SuperTrap super("Super Trap");


	super.vaulthunter_dot_exe("da target");
	super.ninjaShoebox(ScavTrap("SCAVTRAP"));
	std::cout << super << std::endl;
	return (0);
}
Ejemplo n.º 3
0
int main(void)
{

	std::cout << "############----EX00----###############" << std::endl << std::endl ;
	{
		{
			FragTrap f1;

			while (f1.getHitPoints() > 0)
			{
				f1.beRepaired(5);
				f1.takeDamage(25);
				f1.meleeAttack("Warior");
				f1.rangedAttack("Robot");
				f1.vaulthunter_dot_exe("Man");
				std::cout << std::endl;
				std::cout << "Hit Points: " << f1.getHitPoints() << std::endl;
			}
		}

		std::cout << "_________________" << std::endl;

		{
			FragTrap f2("NOOD");
			while (f2.getHitPoints() > 0)
			{
				f2.beRepaired(5);
				f2.takeDamage(35);
				f2.vaulthunter_dot_exe("Man");

				std::cout << std::endl;
				std::cout << "Hit Points: " << f2.getHitPoints() << std::endl;
			}
		}
	}
	std::cout << std::endl << "############----EX01----###############" << std::endl << std::endl;
	{
		std::cout << "_______FR4G_______" << std::endl;
		{
			FragTrap f1;

			while (f1.getHitPoints() > 0)
			{
				f1.beRepaired(5);
				f1.takeDamage(25);
				f1.meleeAttack("Warior");
				f1.rangedAttack("Robot");
				f1.vaulthunter_dot_exe("Man");
				std::cout << std::endl;
				std::cout << "Hit Points: " << f1.getHitPoints() << std::endl;
			}
		}

		std::cout << "_______SC4V_______" << std::endl;
		{
			ScavTrap s1("BOT");
			while (s1.getHitPoints() > 0)
			{
				s1.beRepaired(5);
				s1.takeDamage(35);
				s1.challengeNewcomer("Woman");

				std::cout << std::endl;
				std::cout << "Hit Points: " << s1.getHitPoints() << std::endl;
			}
		}
	}
	std::cout << std::endl << "############----EX02----###############" << std::endl << std::endl ;
	{
		std::cout << "_______FR4G_______" << std::endl;
		FragTrap *f1 = new FragTrap("Yana");

		while (f1->getHitPoints() > 0)
		{
			f1->beRepaired(5);
			f1->takeDamage(25);
			f1->meleeAttack("Warior");
			f1->rangedAttack("Robot");
			f1->vaulthunter_dot_exe("Man");
			std::cout << std::endl;
			std::cout << "Hit Points: " << f1->getHitPoints() << std::endl;
		}
		delete f1;

		std::cout << "_______SC4V_______" << std::endl;

		ScavTrap *s1 = new ScavTrap("Paul");
		while (s1->getHitPoints() > 0)
		{
			s1->beRepaired(5);
			s1->takeDamage(35);
			s1->challengeNewcomer("Woman");

			std::cout << std::endl;
			std::cout << "Hit Points: " << s1->getHitPoints() << std::endl;
		}
		delete s1;
	}
	std::cout << std::endl << "############----EX03----###############" << std::endl << std::endl;
	{
		std::cout << "_______FR4G_______" << std::endl;
		FragTrap *f1 = new FragTrap("Robot");

		std::cout << "_______SC4V_______" << std::endl;
		ScavTrap *s1 = new ScavTrap("Warior");

		std::cout << "_______NINJA_______" << std::endl;
		NinjaTrap *n1 = new NinjaTrap("Boss");
		std::cout << "_______CLAP_______" << std::endl;
		ClapTrap *c1 = new ClapTrap();

		n1->takeDamage(20);
		n1->beRepaired(10);

		n1->ninjaShoebox(*n1);
		n1->ninjaShoebox(*f1);
		n1->ninjaShoebox(*s1);
		n1->ninjaShoebox(*c1);

		std::cout << "_______CLAP_______" << std::endl;
		delete c1;
		std::cout << "_______NINJA_______" << std::endl;
		delete n1;
		std::cout << "_______SC4V_______" << std::endl;
		delete s1;
		std::cout << "_______FR4G_______" << std::endl;
		delete f1;
	}

	std::cout << std::endl << "############----EX04----###############" << std::endl << std::endl;
	{

		SuperTrap *s1 = new SuperTrap("Fat Super Hero");
		s1->rangedAttack("You");
		s1->meleeAttack("Silm Man");


		ScavTrap sc1 = ScavTrap("The Scav");
		s1->ninjaShoebox(sc1);
		s1->vaulthunter_dot_exe("A Peon");

		delete s1;
	}
	return (0);
}