Пример #1
0
void st03::init(){
    increaseStrength();
	while(getPoint()){
		if(getPoint())increaseHealth();
		if(getPoint())increaseSpeed();
	}
}
Пример #2
0
void ch_att::init()
{
	myID=getID();
	getInfo();
	for (int i=1;i<=4;i++)
	 increaseHealth();
	for (int i=1;i<=2;i++)
	 increaseStrength();
	for (int i=1;i<=4;i++)
	 increaseSpeed();
}
Пример #3
0
void testAI::play()
{
    while(getPoint())
    {
        increaseSpeed();
        increaseStrength();
        increaseHealth();
    }
    int i,j,x,y,flag=0,t1,t2;
    x=getX();
    y=getY();
    for(i=1;i<=N;i++)
    {
        for(j=1;j<=M;j++)
        {
            if(abs(i-x)+abs(j-y)<=getSp())
            {
                if(askWhat(i-1,j)>0 || askWhat(i+1,j)>0 || askWhat(i,j-1)>0 || askWhat(i,j+1)>0)
                {
                    move(i,j);
                    flag=1;
                    break;
                }
                t1=i;t2=j;
            }
        }
        if(flag)break;
    }
    if(!flag)move(t1,t2);
    if(askWhat(i-1,j)>0)
    {
        attack(i-1,j);
        return;
    }
    if(askWhat(i+1,j)>0)
    {
        attack(i+1,j);
        return;
    }
    if(askWhat(i,j-1)>0)
    {
        attack(i,j-1);
        return;
    }
    if(askWhat(i,j+1)>0)
    {
        attack(i,j+1);
        return;
    }

}
Пример #4
0
void ch_att::assignPoints()
{
	long est=0;
	
	// Health
	while (point>0 && hp<att*7/3)
	 {
		point--;
		increaseHealth();
	 }
	// Speed
	est=targetSpeed();
	while (point>0 && sp<SpeedCap && sp<=est)
	 {
		point--;
		increaseSpeed();
	 }
	// Strength
	while (point>0)
	 {
		point--;
		increaseStrength();
	 }
}
Пример #5
0
void testAI::init()
{
    increaseHealth();
    increaseStrength();
    while(getPoint())increaseSpeed();
}