public override void helpTo(Warriors we) { if (CDTime.isCoolDown()) { return; } Warrior target = this; int min = this.attackDistance; for (int i = we.size() - 1; i >= 0; --i) { if (we.At(i) is Rescue) { continue; } if (we.At(i).fullHP()) { continue; } if (this.distance(we.At(i)) <= min) { min = this.distance(we.At(i)); target = we.At(i); } } target.addHP(this.power); CDTime.record(); }
//public float time2; // Use this for initialization void Start() { instance = this; cd = new CDTime[2]; cd[0] = new CDTime(cd1); cd[1] = new CDTime(cd2); }
public override void attackTo(Warriors they) { if (CDTime.isCoolDown() || they.size() == 0) { return; } if (this.distance(they.frontLine()) <= this.attackDistance) { img.Image = myRealStatus[(int)Status.attack]; attackGroup(they.frontGroup()); CDTime.record(); } }
public Rescue(bool isMe) { type = Warrior_Type.helper; myStatus = Const.imageList[(int)WarriorList.Rescue]; myRealStatus = myStatus[Const.Part.A]; if (isMe) { setValueFrom(Program.playerData[6]); } else { setValueFrom(Program.AIData[6]); } CDTime.setCoolDownTime(15); img.Image = myRealStatus[(int)Status.move]; img.Top = Const.mainLineHeight - Const.warriorHeight; }
public Hatchet(bool isMe) { type = Warrior_Type.attacker; myStatus = Const.imageList[(int)WarriorList.Hatchet]; myRealStatus = myStatus[Const.Part.A]; if (isMe) { setValueFrom(Program.playerData[3]); } else { setValueFrom(Program.AIData[3]); } setBonus(10); CDTime.setCoolDownTime(15); img.Image = myRealStatus[(int)Status.move]; img.Top = Const.mainLineHeight - Const.warriorHeight; }
void Awake() { cd = new CDTime(cdTime); }