Exemple #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;
}
Exemple #2
0
static void testNinjaSpecials(NinjaTrap &nt)
{
    std::cout << std::endl << "NINJA SPE TESTS" << std::endl;
    
    ScavTrap s("sisi");
    ClapTrap c("coco");
    NinjaTrap n("nana");
    FragTrap f("fafa");

    nt.ninjaShoebox(s);
    nt.ninjaShoebox(c);
    nt.ninjaShoebox(n);
    nt.ninjaShoebox(f);
}
Exemple #3
0
void	attack(NinjaTrap & p1, ClapTrap & p2)
{
	int rand1 = rand() % 3;
	if (rand1 == 0)
	{
		p1.rangedAttack(p2.getName());
		p2.takeDamage(p1.getRanged_attack_dmg());
	}
	else if (rand1 == 1)
	{
		p1.meleeAttack(p2.getName());
		p2.takeDamage(p1.getMelee_attack_dmg());
	}
	else
		p1.ninjaShoebox(p2);
}