public override void Updata() { if (this.over) { return; } if (this.moveflame) { if (this.count == this.nextmake) { this.make = true; this.hitting = false; this.positionre.X = this.position.X + this.UnionRebirth; if (this.positionre.X >= 0 && this.positionre.X < 6 && this.positionre.Y >= 0 && this.positionre.Y < 3 && (!this.parent.panel[this.positionre.X, this.positionre.Y].Hole)) { Tower tower = new Tower(this.sound, this.parent, this.positionre.X, this.positionre.Y, this.union, this.power, this.nextmake, this.element) { badstatus = this.badstatus, badstatustime = this.badstatustime }; this.parent.attacks.Add(tower); } this.positionre = this.position; } ++this.count; if (this.frame >= 100) { this.flag = false; } switch (this.element) { case ChipBase.ELEMENT.normal: switch (this.motion) { case Tower.MOTION.init: this.animationpoint.X = this.frame; if (this.frame >= 5) { this.hitting = true; this.motion = Tower.MOTION.set; break; } break; case Tower.MOTION.set: this.animationpoint.X = 3; if (this.frame >= this.time) { this.hitting = false; this.frame = 0; this.motion = Tower.MOTION.end; break; } break; case Tower.MOTION.end: this.animationpoint.X = 5 - this.frame; if (this.frame >= 5) { this.frame = 0; this.flag = false; break; } break; } break; case ChipBase.ELEMENT.heat: case ChipBase.ELEMENT.aqua: case ChipBase.ELEMENT.leaf: case ChipBase.ELEMENT.earth: switch (this.motion) { case Tower.MOTION.init: this.animationpoint.X = this.frame; if (this.frame >= 3) { this.hitting = true; this.motion = Tower.MOTION.set; break; } break; case Tower.MOTION.set: this.animationpoint.X = 3; if (this.frame >= this.time) { this.hitting = false; this.frame = 0; this.motion = Tower.MOTION.end; if (this.element == ChipBase.ELEMENT.heat && this.StandPanel.state == Panel.PANEL._grass) { this.StandPanel.state = Panel.PANEL._nomal; } break; } break; case Tower.MOTION.end: this.animationpoint.X = 4 - this.frame; if (this.frame >= 3 && this.make) { this.flag = false; break; } break; } break; case ChipBase.ELEMENT.eleki: switch (this.motion) { case Tower.MOTION.init: this.animationpoint.X = this.frame; if (this.frame >= 3) { this.hitting = true; this.motion = Tower.MOTION.set; break; } break; case Tower.MOTION.set: this.animationpoint.X = this.frame; if (this.frame >= 3 && this.make) { this.hitting = false; this.frame = 0; this.motion = Tower.MOTION.end; break; } break; case Tower.MOTION.end: this.flag = false; break; } break; case ChipBase.ELEMENT.poison: this.animationpoint.X = this.frame; if (this.frame == 4) { this.hitting = false; if (this.StandPanel.state == Panel.PANEL._grass) { this.StandPanel.state = Panel.PANEL._poison; } } if (this.frame >= 13 && this.make) { this.flag = false; break; } break; } } this.FlameControl(); }
public Tower( IAudioEngine so, SceneBattle p, int pX, int pY, Panel.COLOR u, int po, int s, ChipBase.ELEMENT ele) : base(so, p, pX, pY, u, po, ele) { if (!this.InArea) { this.flag = false; } else if (!this.StandPanel.Hole) { this.motion = Tower.MOTION.init; this.nextmake = s; this.element = ele; this.time = 1; this.speed = 2; this.animationpoint.X = 0; this.hitrange = new Point(0, 0); this.hitting = false; this.rebirth = this.union == Panel.COLOR.blue; this.positionre = this.position; this.positionDirect = new Vector2(this.position.X * 40 + 20, this.position.Y * 24 + 82); this.frame = 0; switch (this.element) { case ChipBase.ELEMENT.normal: this.sound.PlaySE(SoundEffect.shotwave); break; case ChipBase.ELEMENT.heat: this.sound.PlaySE(SoundEffect.heat); break; case ChipBase.ELEMENT.aqua: this.sound.PlaySE(SoundEffect.shotwave); break; case ChipBase.ELEMENT.eleki: this.sound.PlaySE(SoundEffect.bomb); break; case ChipBase.ELEMENT.leaf: this.sound.PlaySE(SoundEffect.shotwave); break; case ChipBase.ELEMENT.poison: this.hitting = true; this.sound.PlaySE(SoundEffect.bomb); break; case ChipBase.ELEMENT.earth: this.sound.PlaySE(SoundEffect.sand); break; } } else { this.flag = false; } }