/// <summary> /// Draws attack animiation and reduces boss's health. /// </summary> /// <param name="gun">If a the player has a gun different animations are shown /// </param> void DrawAttackNumberReduceBossHealth(bool gun) { var GunAttackAnimation = new GunAttack(); var SwordAttackAnimation = new SwordAttack(); int attackNumber = 0; if (gun) { GunAttackAnimation.InitialPlacements(); GunAttackAnimation.DrawMe(); GunAttackAnimation.Placement.Y = 10; attackNumber = Gun.Stats.Attack + Player.Stats.Attack; Console.SetCursorPosition(73, 12); Console.Write(attackNumber); Thread.Sleep(300); GunAttackAnimation.DeleteMe(); } else { SwordAttackAnimation.InitialPlacements(); SwordAttackAnimation.DrawMe(); SwordAttackAnimation.Placement.Y = 10; attackNumber = Sword.Stats.Attack + Player.Stats.Attack; Console.SetCursorPosition(75, 12); Console.Write(attackNumber); Thread.Sleep(300); SwordAttackAnimation.DeleteMe(); } Boss.Stats.HealthPower -= attackNumber; Gun.Stats.Attack = randomNumber.Next(10, 20); Sword.Stats.Attack = randomNumber.Next(10, 20); }
public Warrior(string name, int health) { CharacterClass = "Warrior"; attackBehavior = new SwordAttack(); Name = name; Health = health; }
public override void Action(CharacterBase character, SceneBattle battle) { if (character.waittime == 3) { this.sound.PlaySE(SoundEffect.sword); } character.animationpoint = CharacterAnimation.SworsAnimation(character.waittime); if (character.waittime >= 30) { base.Action(character, battle); } if (character.waittime != 10) { return; } int num = this.power + this.pluspower; bool par = false; if (character is Player && ((Player)character).style == Player.STYLE.shinobi) { par = true; } SwordAttack swordAttack = new SwordAttack(this.sound, character.parent, character.position.X + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 3, this.element, par, false); character.parent.attacks.Add(this.Paralyze(swordAttack, character)); }
private void OnTriggerEnter2D(Collider2D collision) { Collider2D collider = collision; Debug.Log("Dungeon: collision " + collider); if (collider.tag == TAG.SWORD) { SwordAttack swordAttack = collider.GetComponent <SwordAttack>(); if (swordAttack.attacking) { Debug.Log("Attacked" + swordAttack.baseWeapon.damage); swordAttack.attacking = false; this.GotDamage(swordAttack.baseWeapon.damage, collider); } } else if (collider.tag == TAG.BULLET) { Bullet bullet = collider.GetComponent <Bullet>(); if (bullet != null) { Debug.Log("Attacked" + bullet.GetDamage()); this.GotDamage(bullet.GetDamage(), collider); } } }
public override void Action() { if (this.player.waittime == 3) { this.sound.PlaySE(SoundEffect.sword); } this.player.animationpoint = CharacterAnimation.SworsAnimation(this.player.waittime); if (this.player.waittime >= 30) { this.End(); this.player.motion = Player.PLAYERMOTION._neutral; } if (this.player.waittime != 10) { return; } int power = this.power; bool flag = false; if (this.player.style == Player.STYLE.shinobi) { flag = true; } AttackBase attackBase = new SwordAttack(this.sound, this.player.parent, this.player.position.X + this.UnionRebirth(this.player.union), this.player.position.Y, this.player.union, !this.player.badstatus[1] ? player.busterPower * this.power : player.busterPower * this.power / 2, 3, this.player.Element, this.player.style == Player.STYLE.shinobi, false); attackBase.canCounter = false; this.player.parent.attacks.Add(attackBase); }
void Start() { swordattack = GameObject.Find("Sword").GetComponent <SwordAttack> (); staminaBar = GameObject.Find("DashBar").GetComponent <Slider> (); staminaBar.maxValue = swordattack.dashStartCooldown; staminaBar.minValue = 0; }
// Start is called before the first frame update void Start() { playerController = GetComponent <PlayerController>(); swordAttack = GetComponent <SwordAttack>(); playerAttackAnimator = GetComponent <Animator>(); AddWeaponToSlot(); EquipWeapon(); }
// Use this for initialization void Start () { swordAttack = GetComponent<SwordAttack>(); areaAttack = GetComponent<AreaAttack>(); missileAttack = GetComponent<MissileAttack>(); playerRotation = GetComponent<PlayerRotation>(); }
protected virtual WorldModel AverageState(WorldModel[] tests, SwordAttack enemy) { int hp = 0; int shieldHp = 0; int xp = 0; int baseXp = 0; int deadEnemies = 0; bool enemyAlive = true; for (int i = 0; i < this.MaxPlayouts; i++) { hp += (int)tests[i].GetProperty(Properties.HP); shieldHp += (int)tests[i].GetProperty(Properties.ShieldHP); if ((bool)tests[i].GetProperty(enemy.Target.name) == false) { xp += (int)tests[i].GetProperty(Properties.XP); switch (enemy.Target.tag) { case "Skeleton": baseXp = xp - 3; break; case "Orc": baseXp = xp - 10; break; case "Dragon": baseXp = xp - 20; break; } deadEnemies++; } } hp /= this.MaxPlayouts; shieldHp /= this.MaxPlayouts; if (deadEnemies > this.MaxPlayouts / 2) { xp /= deadEnemies; enemyAlive = false; } else { xp = baseXp; } WorldModel average = tests[0]; average.SetProperty(Properties.HP, hp); average.SetProperty(Properties.ShieldHP, shieldHp); average.SetProperty(enemy.Target.name, enemyAlive); average.SetProperty(Properties.XP, xp); return(average); }
// Use this for initialization void Start() { // Delegate to use two functions at once _objectSetup += Follow; _objectSetup += SetTransform; _ss = GetComponent <SwordAttack>(); _player = GameObject.Find("Player").GetComponent <Player>(); _whichSword = GetComponent <SpriteRenderer>(); DontDestroyOnLoad(gameObject); }
void Attack() { isAttacking = true; anim.SetBool("isAttacking", true); moving = false; anim.SetBool("isMoving", false); SwordAttack sword = GetComponentInChildren <SwordAttack>(); sword.SetCanDealDamage(true); }
protected override void AnimFireCallBackBody() { base.AnimFireCallBackBody(); //创建剑气 并且赋值给剑气 Vector2 position = transform.position; Vector2 tmpOffset = transform.parent.right * attackBodyOffset; // 使用weaponPoint的right 因为自己的在执行动画 改了了方向 position = position + tmpOffset; sa = Instantiate((GameObject)Resources.Load("Weapon/AttackBody/" + attackBodyPrefabName), position, transform.parent.rotation).GetComponent <SwordAttack>(); sa.configSwordAttack(this); Invoke("AttackBodyAnimStart", 0); }
// Use this for initialization void Start() { //player = FindObjectOfType<PlayerController>(); //Find player camera = FindObjectOfType <CameraController>(); //Find camera weapon = FindObjectOfType <WeaponCharge>(); //Find weapon healthManager = FindObjectOfType <HealthManager>(); sword = FindObjectOfType <SwordAttack>(); }
//method to average out and apply the effects of a sword attack playout in a stochastic world private IWorldModel MergeStates(IWorldModel[] testStates, SwordAttack enemy) { int hp = 0; int shieldHP = 0; int enemyDeadCount = 0; bool enemyAlive = true; int xp = 0; int n = testStates.Length; for (int i = 0; i < n; i++) { hp += (int)testStates[i].GetProperty(Properties.HP); shieldHP += (int)testStates[i].GetProperty(Properties.SHIELDHP); if ((bool)testStates[i].GetProperty(enemy.Target.tag) != true) { xp += (int)testStates[i].GetProperty(Properties.XP); enemyDeadCount++; } } hp = hp / n; shieldHP = shieldHP / n; if (enemyDeadCount > ((float)n / 2)) //enemy is dead on average, rounded up { xp = xp / enemyDeadCount; enemyAlive = false; } else { xp = 0; } //returning the testState[0] as the resulting average IWorldModel returnState = testStates[0]; returnState.SetProperty(Properties.HP, hp); returnState.SetProperty(Properties.SHIELDHP, shieldHP); returnState.SetProperty(enemy.Target.name, enemyAlive); returnState.SetProperty(Properties.XP, xp); return(returnState); }
public Skill CreateSkill() { Skill skill; switch (Type) { case "swordAttack": skill = new SwordAttack(Type, T1, T2, T3, T4, Power, UpgradeWith, Image); break; case "shieldBlock": skill = new ShieldBlock(Type, T1, T2, T3, T4, Power, UpgradeWith, Image); break; case "heal": skill = new Heal(Type, T1, T2, T3, T4, Power, UpgradeWith, Image); break; default: throw new UnityException("Skill type not recognized"); } return(skill); }
public override void Action(CharacterBase character, SceneBattle battle) { if (!this.BlackOut(character, battle, this.name, this.Power(character).ToString())) { return; } ++this.chargeanime; if (this.moveflame) { switch (this.nowmotion) { case 0: switch (this.frame) { case 1: this.xPosition = character.positionDirect; character.positionDirect.X -= 8 * this.UnionRebirth(character.union); character.positionDirect.Y -= 8f; this.xPosition.X += 48 * this.UnionRebirth(character.union); this.xPosition.Y += 8f; this.sound.PlaySE(SoundEffect.warp); this.animePoint = new Point(); this.chargeEffect = 0; break; case 5: this.sound.PlaySE(SoundEffect.charge); this.chargeEffect = 1; break; case 30: this.chargeEffect = 2; break; case 55: this.chargeEffect = 0; ++this.nowmotion; this.frame = 0; int num = 18; while (this.positions.Count < num) { for (int x = 0; x < battle.panel.GetLength(0); ++x) { for (int y = 0; y < battle.panel.GetLength(1); ++y) { if (battle.panel[x, y].color == character.UnionEnemy) { this.positions.Add(new Point(x, y)); this.positions2.Add(new Point(x, y)); } } } } this.positions2 = this.positions2.OrderBy <Point, Guid>(i => Guid.NewGuid()).ToList <Point>(); this.positions = this.positions.OrderBy <Point, Guid>(i => Guid.NewGuid()).ToList <Point>(); break; } break; case 1: int waitflame = this.frame % 6; character.animationpoint = this.AnimeBuster(waitflame % 3); this.animePoint.X = !this.swing ? this.AnimeSlash2(waitflame).X : this.AnimeSlash1(waitflame).X; switch (waitflame) { case 0: if (this.attackCount >= 24) { ++this.nowmotion; this.frame = 0; break; } this.sound.PlaySE(SoundEffect.damageenemy); battle.effects.Add(new NormalChargehit(this.sound, battle, this.positions[this.count1].X, this.positions[this.count1].Y, 2)); ++this.count1; if (this.count1 >= this.positions.Count) { this.count1 = 0; } this.swing = !this.swing; new BombAttack(this.sound, character.parent, character.union == Panel.COLOR.red ? 0 : 5, 0, character.union, 0, 1, 1, new Point(5, 3), this.element) { bright = false }.invincibility = false; break; case 3: this.sound.PlaySE(SoundEffect.sword); this.sound.PlaySE(SoundEffect.damageenemy); battle.effects.Add(new NormalChargehit(this.sound, battle, this.positions[this.count1].X, this.positions[this.count1].Y, 3)); ++this.count1; if (this.count1 >= this.positions.Count) { this.count1 = 0; } AttackBase attackBase = new SwordAttack(this.sound, battle, this.positions2[this.count2].X, this.positions2[this.count2].Y, character.union, 0, 3, this.element, false, false); attackBase.hitting = false; battle.attacks.Add(attackBase); ++this.count2; if (this.count2 >= this.positions2.Count) { this.count2 = 0; } BombAttack bombAttack = new BombAttack(this.sound, character.parent, character.union == Panel.COLOR.red ? 0 : 5, 0, character.union, this.Power(character), 1, 1, new Point(5, 3), this.element); bombAttack.invincibility = false; bombAttack.bright = false; if ((uint)this.attacking > 0U) { bombAttack.power = 0; } ++this.attacking; if (this.attacking >= 4) { this.attacking = 0; } ++this.attackCount; battle.attacks.Add(bombAttack); break; } break; case 2: switch (this.frame) { case 30: character.animationpoint = new Point(); character.PositionDirectSet(); this.chargeEffect = -1; this.end = true; ++this.nowmotion; this.frame = 0; break; } break; } } if (this.end && this.BlackOutEnd(character, battle)) { base.Action(character, battle); } this.FlameControl(2); }
public override void Action(CharacterBase character, SceneBattle battle) { if (!this.BlackOut(character, battle, this.name, this.Power(character).ToString())) { return; } if (character is Player) { Player player = (Player)character; if (this.nowmotion == 0 && this.frame < 3 && (Input.IsPush(Button._A) && this.command == 0) && this.commandTime < 60) { this.CommandInput("上下左右B", player); if (this.CommandCheck("下左上右下")) { this.command = 4; } else if (this.CommandCheck("左B右B")) { this.command = 5; } } } if (this.moveflame) { switch (this.nowmotion) { case 0: this.animePoint.X = this.AnimeMove(this.frame).X; switch (this.frame) { case 1: character.animationpoint.X = -1; this.xPosition = character.position.X; this.sound.PlaySE(SoundEffect.warp); break; case 2: if (character is Player && (Input.IsPush(Button._A) && this.command == 0 && this.commandTime < 60)) { this.frame = 1; break; } break; case 3: if (this.CommandCheck("下左上右下")) { this.sound.PlaySE(SoundEffect.CommandSuccess); this.command = 4; } else if (this.CommandCheck("左B右B")) { this.sound.PlaySE(SoundEffect.CommandSuccess); this.command = 5; } if (this.command == 5) { this.xPosition = character.position.X; ++this.nowmotion; this.frame = 0; break; } break; case 5: this.xPosition = this.TargetX(character, battle); if (this.xPosition < 0) { this.xPosition = 0; } if (this.xPosition > 5) { this.xPosition = 5; break; } break; case 9: ++this.nowmotion; this.frame = 0; break; } break; case 1: this.animePoint.X = this.AnimeSlash1(this.frame).X; switch (this.frame) { case 5: if (character is Player && this.command == 0) { Player player = (Player)character; if (Input.IsPush(Button.Right)) { this.sound.PlaySE(SoundEffect.CommandSuccess); this.command = 1; } else if (Input.IsPush(Button.Up)) { this.sound.PlaySE(SoundEffect.CommandSuccess); this.command = 2; } else if (Input.IsPush(Button.Left)) { this.sound.PlaySE(SoundEffect.CommandSuccess); this.command = 3; } break; } break; case 6: this.sound.PlaySE(SoundEffect.sword); AttackBase a1 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); switch (this.command) { case 1: a1 = new FighterSword(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element); break; case 2: a1 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); break; case 3: a1 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); break; case 4: a1 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); break; case 5: a1 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, false); break; } a1.invincibility = false; battle.attacks.Add(this.Paralyze(a1)); break; case 10: ++this.nowmotion; this.frame = 0; break; } break; case 2: this.animePoint.X = this.AnimeSlash2(this.frame).X; switch (this.frame) { case 6: this.sound.PlaySE(SoundEffect.sword); AttackBase a2 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); switch (this.command) { case 1: a2 = new FighterSword(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element); break; case 2: a2 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); break; case 3: a2 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); break; case 4: a2 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); break; case 5: a2 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, false); break; } a2.invincibility = false; battle.attacks.Add(this.Paralyze(a2)); break; case 10: ++this.nowmotion; this.frame = 0; break; } break; case 3: this.animePoint.X = this.AnimeSlash3(this.frame).X; switch (this.frame) { case 6: this.sound.PlaySE(SoundEffect.sword); AttackBase a3 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); switch (this.command) { case 1: a3 = new FighterSword(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element); break; case 2: a3 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); break; case 3: a3 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); break; case 4: a3 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); break; case 5: a3 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, false); break; } a3.invincibility = false; battle.attacks.Add(this.Paralyze(a3)); break; case 10: ++this.nowmotion; this.frame = 0; break; } break; case 4: this.animePoint.X = this.AnimeSlash2(this.frame).X; switch (this.frame) { case 6: this.sound.PlaySE(SoundEffect.sword); AttackBase a4 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); switch (this.command) { case 1: a4 = new FighterSword(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element); break; case 2: a4 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); break; case 3: a4 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); break; case 4: a4 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); break; case 5: a4 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, false); break; } a4.invincibility = false; battle.attacks.Add(this.Paralyze(a4)); break; case 10: ++this.nowmotion; this.frame = 0; break; } break; case 5: this.animePoint.X = this.AnimeSlash1(this.frame).X; switch (this.frame) { case 6: this.sound.PlaySE(SoundEffect.sword); AttackBase a5 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, true); switch (this.command) { case 1: a5 = new FighterSword(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element); break; case 2: a5 = new SwordAttack(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false, false); break; case 3: a5 = new SwordCloss(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character) / 2, 4, this.element, false); break; case 4: a5 = new Halberd(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 4, this.element, false); break; case 5: a5 = new SonicBoom(this.sound, battle, this.xPosition + this.UnionRebirth(character.union), character.position.Y, character.union, this.Power(character), 8, this.element, false); break; } a5.invincibility = true; battle.attacks.Add(this.Paralyze(a5)); break; case 30: character.parent.effects.Add(new MoveEnemy(this.sound, character.parent, this.xPosition, character.position.Y)); this.end = true; ++this.nowmotion; this.frame = 0; break; } break; } } if (this.end && this.BlackOutEnd(character, battle)) { base.Action(character, battle); } this.FlameControl(2); }
protected override void Moving() { this.neutlal = this.Motion == NaviBase.MOTION.neutral; switch (this.Motion) { case NaviBase.MOTION.neutral: if (this.moveflame) { ++this.waittime; } if (this.moveflame) { this.animationpoint = this.AnimeNeutral(this.waittime); if (this.waittime >= (this.beast ? 2 : 8 - Math.Min(6, (int)this.version))) { this.waittime = 0; ++this.roopneutral; if (this.roopneutral >= 1 && this.parent.nowscene != SceneBattle.BATTLESCENE.end) { this.roopneutral = 0; if (this.roopmove > this.moveroop && !this.badstatus[4]) { this.roopmove = 0; this.roopmove = this.version > 3 ? this.Random.Next(-1, this.moveroop + 1) : 0; ++this.atackroop; if (!this.atack) { int index = this.Random.Next(4); this.attack = (HakutakuMan.ATTACK)index; this.powerPlus = this.powers[index]; } this.waittime = 0; this.attackFlag = true; this.Motion = NaviBase.MOTION.move; this.counterTiming = true; } else { this.waittime = 0; this.Motion = NaviBase.MOTION.move; } } } break; } break; case NaviBase.MOTION.attack: if (this.moveflame) { ++this.waittime; if (this.moveflame) { switch (this.attack) { case HakutakuMan.ATTACK.WideCrow: if (!this.beast) { this.animationpoint = this.AnimeWide(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); this.parent.attacks.Add(new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false)); break; case 10: this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } else { if (this.attackCombo == 0) { this.animationpoint = this.AnimeWideBO(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); AttackBase attackBase = new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false); attackBase.invincibility = false; this.parent.attacks.Add(attackBase); break; case 8: ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } else { this.animationpoint = this.AnimeLongBO(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); this.parent.attacks.Add(new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true)); break; case 10: this.attackCombo = 0; this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } break; } break; case HakutakuMan.ATTACK.LongCrow: if (!this.beast) { this.animationpoint = this.AnimeLong(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); this.parent.attacks.Add(new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true)); break; case 10: this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } else { if (this.attackCombo == 0) { this.animationpoint = this.AnimeLongBO(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); AttackBase attackBase = new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, true); attackBase.invincibility = false; this.parent.attacks.Add(attackBase); break; case 8: ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } else { this.animationpoint = this.AnimeWideBO(this.waittime); switch (this.waittime) { case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.shotwave); this.parent.attacks.Add(new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false, false)); break; case 10: this.attackCombo = 0; this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } break; } break; case HakutakuMan.ATTACK.Miss: if (!this.beast) { this.animationpoint = this.AnimeMiss(this.waittime); switch (this.waittime) { case 7: case 9: this.counterTiming = false; this.sound.PlaySE(SoundEffect.lance); break; case 13: this.sound.PlaySE(SoundEffect.canon); this.sound.PlaySE(SoundEffect.damageenemy); this.whitetime = 4; this.hp -= 20 * version; break; case 20: this.motion = NaviBase.MOTION.move; this.frame = 0; this.roopneutral = 0; this.waittime = 0; this.speed = this.nspeed; break; } } else { this.animationpoint = this.AnimeCrossBO(this.waittime); switch (this.waittime) { case 6: this.sound.PlaySE(SoundEffect.shotwave); this.parent.attacks.Add(new SwordCloss(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 3, this.element, false)); break; case 10: this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } break; } break; case HakutakuMan.ATTACK.Hadouken: if (!this.beast) { this.animationpoint = this.AnimeHadou(this.waittime); switch (this.waittime) { case 8: this.counterTiming = false; int x = this.RandomTarget().X; int num1 = 1; int num2 = 8; AttackBase attackBase = new FireBreath(this.sound, this.parent, this.position.X + num1 * this.UnionRebirth(this.union), this.position.Y, this.union, this.Power, 2, this.element, x); attackBase.positionDirect.Y += num2; this.parent.attacks.Add(attackBase); break; case 16: this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } } else { switch (this.attackCombo) { case 0: this.animationpoint = this.AnimeSpin1BO(this.waittime); if (this.waittime == 4) { this.counterTiming = false; this.guard = CharacterBase.GUARD.guard; switch (this.position.Y) { case 0: this.spinUP = false; this.spinGo = true; break; case 2: this.spinUP = true; this.spinGo = true; break; default: this.spinGo = false; break; } this.PositionDirectSet(); this.HitFlagReset(); this.sound.PlaySE(SoundEffect.knife); this.effecting = true; ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; this.DammySet(); break; } break; case 1: this.animationpoint = this.AnimeSpin2BO(this.waittime % 4); if (this.spinGo) { if (this.SlideMove(movespeed, 0)) { this.SlideMoveEnd(); this.PositionDirectSet(); this.spinGo = false; break; } break; } if (this.spinUP) { if (this.SlideMove(movespeed, 2)) { this.SlideMoveEnd(); Point position = this.position; --position.Y; if (!this.InAreaCheck(position)) { this.spinUP = !this.spinUP; position = this.position; position.X += this.UnionRebirth(this.union); if (!this.InAreaCheck(position)) { ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; } this.PositionDirectSet(); this.spinGo = true; } } } else if (this.SlideMove(movespeed, 3)) { this.SlideMoveEnd(); Point position = this.position; ++position.Y; if (!this.InAreaCheck(position)) { this.spinUP = !this.spinUP; position = this.position; position.X += this.UnionRebirth(this.union); if (!this.InAreaCheck(position)) { this.HitFlagReset(); ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; } this.PositionDirectSet(); this.spinGo = true; } } break; case 2: this.animationpoint = this.AnimeSpin2BO(this.waittime % 3); if (this.SlideMove(movespeed, 1)) { Point position = this.position; position.X -= this.UnionRebirth(this.union); if (!this.InAreaCheck(position)) { this.guard = CharacterBase.GUARD.none; this.effecting = false; ++this.attackCombo; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; } break; } break; default: this.animationpoint = this.AnimeSpin3BO(this.waittime); if (this.waittime == 4) { this.effecting = false; this.attackCombo = 0; this.motion = NaviBase.MOTION.move; this.frame = 0; this.speed = this.nspeed; this.roopneutral = 0; this.waittime = 0; break; } break; } break; } break; } } break; } break; case NaviBase.MOTION.move: this.animationpoint = this.AnimeMove(this.waittime); if (this.moveflame) { switch (this.waittime) { case 0: if (!this.attackFlag || this.attack == HakutakuMan.ATTACK.Hadouken) { this.MoveRandom(false, false); } else { Point point = this.RandomTarget(); if (this.Canmove(new Point(point.X - this.UnionRebirth(this.union), point.Y), this.number, this.union == Panel.COLOR.blue ? Panel.COLOR.red : Panel.COLOR.blue) && !this.HeviSand) { this.positionre = new Point(point.X - this.UnionRebirth(this.union), point.Y); } else { this.MoveRandom(true, false); } } if (this.position == this.positionre) { if (this.attackFlag) { this.Motion = NaviBase.MOTION.attack; if (this.beast) { this.speed *= 2; } this.attackFlag = false; switch (this.attack) { case HakutakuMan.ATTACK.WideCrow: this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 2), 60, true)); break; case HakutakuMan.ATTACK.LongCrow: this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(1, 0), 60, true)); break; } } else { this.dammy.flag = false; this.Motion = NaviBase.MOTION.neutral; } this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } break; case 4: var originalPosition = this.position; this.position = this.positionre; this.positionReserved = null; if (this.attackFlag) { this.positionReserved = originalPosition; switch (this.attack) { case HakutakuMan.ATTACK.WideCrow: this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 2), 60, true)); break; case HakutakuMan.ATTACK.LongCrow: this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(1, 0), 60, true)); break; case HakutakuMan.ATTACK.Miss: if (this.beast) { this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, new Point(0, 0), 60, true)); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y - 1, this.union, new Point(0, 0), 60, true)); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X, this.position.Y - 1, this.union, new Point(0, 0), 60, true)); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X + 2 * this.UnionRebirth(this.union), this.position.Y + 1, this.union, new Point(0, 0), 60, true)); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.position.X, this.position.Y + 1, this.union, new Point(0, 0), 60, true)); break; } break; } } this.PositionDirectSet(); break; case 7: if (this.attackFlag) { this.Motion = NaviBase.MOTION.attack; this.attackFlag = false; this.speed *= 2; } else { this.dammy.flag = false; this.Motion = NaviBase.MOTION.neutral; } this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } ++this.waittime; break; } break; case NaviBase.MOTION.knockback: switch (this.waittime) { case 2: this.NockMotion(); this.attackCombo = 0; this.speed = this.nspeed; this.guard = CharacterBase.GUARD.none; this.counterTiming = false; this.effecting = false; this.attackFlag = false; this.PositionDirectSet(); break; case 3: this.NockMotion(); break; case 15: this.animationpoint = new Point(5, 0); this.PositionDirectSet(); break; case 21: this.animationpoint = new Point(0, 0); this.waittime = 0; this.dammy.flag = false; this.Motion = NaviBase.MOTION.move; break; } if (this.waittime >= 2 && this.waittime <= 6) { this.positionDirect.X -= this.UnionRebirth(this.union); } ++this.waittime; break; } if (this.effecting && !this.nohit) { this.AttackMake(this.Power, 0, 0); } this.FlameControl(); this.MoveAftar(); }
protected override void Moving() { this.neutlal = this.Motion == NaviBase.MOTION.neutral; switch (this.Motion) { case NaviBase.MOTION.neutral: if (this.moveflame) { ++this.waittime; } if (this.moveflame) { this.animationpoint = this.AnimeNeutral(this.waittime); if (this.waittime >= 16 / version || this.atack) { this.waittime = 0; ++this.roopneutral; if (this.roopneutral >= 1 && this.parent.nowscene != SceneBattle.BATTLESCENE.end) { this.roopneutral = 0; if (this.roopmove > this.moveroop && !this.badstatus[4]) { this.roopmove = this.version > 3 ? this.Random.Next(-1, 1) : 0; ++this.atackroop; if (this.parent.player.invincibility || this.parent.player.barrierType != CharacterBase.BARRIER.None || this.parent.player.nohit) { this.atack = true; } if (!this.atack) { this.attack = (Youmu.ATTACK) this.pattern[this.action]; if (this.attack == Youmu.ATTACK.RoukanRenzan) { this.powerPlus = this.powers[this.pattern[this.action]] - this.power; } else { this.powerPlus = this.powers[this.pattern[this.action]]; } ++this.action; if (this.action >= this.pattern.Length) { this.action = 0; } this.attackProcess = 0; } else { this.attack = Youmu.ATTACK.Hakurouken; this.powerPlus = this.powers[(int)this.attack]; this.atack = false; } this.waittime = 0; this.Motion = NaviBase.MOTION.attack; } else { this.waittime = 0; if (this.atack) { this.roopmove = this.moveroop + 1; } this.Motion = NaviBase.MOTION.move; } } } break; } break; case NaviBase.MOTION.attack: if (this.moveflame) { ++this.waittime; if (this.moveflame) { switch (this.attack) { case Youmu.ATTACK.RoukanRenzan: switch (this.attackProcess) { case 0: this.animationpoint = this.AnimeSlashUP(0); switch (this.waittime) { case 1: this.target = this.RandomTarget(this.union); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, this.target.Y - 1, this.union, new Point(0, 2), 30, true)); break; case 4: this.counterTiming = true; break; case 8: ++this.attackProcess; this.waittime = 0; break; } break; case 1: this.animationpoint = this.AnimeSlashUP(this.waittime); switch (this.waittime) { case 2: this.sound.PlaySE(SoundEffect.sword); SwordAttack swordAttack1 = new SwordAttack(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, 2, ChipBase.ELEMENT.normal, true, true) { invincibility = false }; this.parent.attacks.Add(swordAttack1); this.target = this.RandomTarget(this.union); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, this.target.Y - 1, this.union, new Point(0, 2), 30, true)); break; case 4: this.counterTiming = false; break; case 8: ++this.attackProcess; this.waittime = 0; break; } break; case 2: this.animationpoint = this.AnimeSlashDOWN(this.waittime); switch (this.waittime) { case 2: this.sound.PlaySE(SoundEffect.sword); SwordAttack swordAttack2 = new SwordAttack(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, 2, ChipBase.ELEMENT.normal, true, true) { invincibility = false }; this.parent.attacks.Add(swordAttack2); if (this.version > 1) { this.target = this.RandomTarget(this.union); this.parent.attacks.Add(new Dummy(this.sound, this.parent, this.target.X, this.target.Y - 1, this.union, new Point(0, 2), 30, true)); break; } break; case 8: if (this.version > 1) { ++this.attackProcess; this.waittime = 0; break; } this.speed = this.nspeed; this.SoulAttack(); this.motion = NaviBase.MOTION.move; this.waittime = 0; break; } break; case 3: this.animationpoint = this.AnimeSlashUP(this.waittime); switch (this.waittime) { case 2: this.sound.PlaySE(SoundEffect.sword); SwordAttack swordAttack3 = new SwordAttack(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, 2, ChipBase.ELEMENT.normal, true, true) { invincibility = false }; this.parent.attacks.Add(swordAttack3); break; case 5: this.speed = this.nspeed; this.SoulAttack(); this.motion = NaviBase.MOTION.move; this.waittime = 0; break; } break; } break; case Youmu.ATTACK.NishinIttaiken: this.animationpoint = this.AnimeSlashNishin(this.waittime); switch (this.waittime) { case 1: this.soul.LostFlag(true); this.guard = CharacterBase.GUARD.none; this.counterTiming = true; this.speed += 2; this.sound.PlaySE(SoundEffect.charge); break; case 10: this.counterTiming = false; this.sound.PlaySE(SoundEffect.sword); int s = 4; AttackBase attackBase1 = new BombWave(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), 0, this.union, this.Power, s, this.element); attackBase1.invincibility = false; this.parent.attacks.Add(attackBase1); AttackBase attackBase2 = new BombWave(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), 1, this.union, this.Power, s, this.element); attackBase2.invincibility = false; this.parent.attacks.Add(attackBase2); AttackBase attackBase3 = new BombWave(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), 2, this.union, this.Power, s, this.element); attackBase3.invincibility = false; this.parent.attacks.Add(attackBase3); break; case 25: this.speed = this.nspeed; this.guard = CharacterBase.GUARD.noDamage; this.motion = NaviBase.MOTION.move; this.waittime = 0; this.soul.LostFlag(false); break; } break; case Youmu.ATTACK.IaiJuujizan: if (this.attackProcess == 0) { this.animationpoint = this.AnimeIai(this.waittime); switch (this.waittime) { case 1: this.counterTiming = true; this.parent.effects.Add(new Flash(this.sound, this.parent, this.positionDirect, this.position)); this.sound.PlaySE(SoundEffect.pikin); this.speed += 2; break; case 2: this.target = this.RandomTarget(this.union); this.effecting = true; this.positionReserved = this.position; this.positionre = new Point(this.union == Panel.COLOR.blue ? 0 : 5, this.target.Y); this.position = this.positionre; this.PositionDirectSet(); break; case 6: this.counterTiming = false; this.sound.PlaySE(SoundEffect.sword); SwordCloss swordCloss = new SwordCloss(this.sound, this.parent, this.target.X, this.target.Y, this.union, this.Power, 2, ChipBase.ELEMENT.normal, true) { invincibility = false }; this.parent.attacks.Add(swordCloss); break; case 25: this.positionReserved = null; this.speed = this.nspeed; this.motion = NaviBase.MOTION.move; this.effecting = false; this.speed = this.nspeed; this.waittime = 0; break; } } break; case Youmu.ATTACK.Hakurouken: this.animationpoint = this.AnimeSlashHakurou(this.waittime); switch (this.waittime) { case 1: this.counterTiming = true; break; case 2: this.sound.PlaySE(SoundEffect.sword); foreach (CharacterBase characterBase in this.parent.AllChara()) { if (characterBase.union == this.UnionEnemy && (characterBase.guard != CharacterBase.GUARD.none || characterBase.invincibilitytime > 0 || characterBase.nohit || (uint)characterBase.barrierType > 0U)) { characterBase.Hp -= this.Power; characterBase.invincibilitytime = 0; characterBase.barrierType = CharacterBase.BARRIER.None; this.sound.PlaySE(SoundEffect.damageenemy); } } break; case 4: this.counterTiming = false; break; case 8: this.speed = this.nspeed; this.motion = NaviBase.MOTION.move; this.waittime = 0; break; } break; } } break; } break; case NaviBase.MOTION.move: this.animationpoint = this.AnimeMove(this.waittime); if (this.moveflame) { switch (this.waittime) { case 0: this.MoveRandom(false, false); if (this.position == this.positionre) { this.Motion = NaviBase.MOTION.neutral; this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } break; case 3: this.position = this.positionre; this.PositionDirectSet(); break; case 5: this.Motion = NaviBase.MOTION.neutral; this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } ++this.waittime; break; } break; case NaviBase.MOTION.knockback: switch (this.waittime) { case 2: this.guard = CharacterBase.GUARD.noDamage; if (this.soul.motion == HalfSoul.MOTION.lost) { this.soul.LostFlag(false); } this.NockMotion(); this.counterTiming = false; this.effecting = false; this.PositionDirectSet(); break; case 3: this.NockMotion(); break; case 15: this.animationpoint = new Point(0, 1); this.PositionDirectSet(); break; case 21: this.animationpoint = new Point(0, 0); this.waittime = 0; this.Motion = NaviBase.MOTION.neutral; break; } if (this.waittime >= 2 && this.waittime <= 6) { this.positionDirect.X -= this.UnionRebirth(this.union); } ++this.waittime; break; } if (this.effecting) { this.AttackMake(this.Power, 0, 0); } this.FlameControl(); this.MoveAftar(); }
void Awake() { swordScript = GameObject.Find("Bat").GetComponent <SwordAttack>(); }
public override void Action(CharacterBase character, SceneBattle battle) { if (!this.BlackOut(character, battle, this.name, this.Power(character).ToString())) { return; } if (this.end) { this.animePoint.X = -1; if (this.BlackOutEnd(character, battle)) { base.Action(character, battle); } } else if (this.targetNow < 0) { if (this.moveflame) { this.animePoint = this.Anime(this.frame); switch (this.frame) { case 1: this.beast = true; this.posi = character.position; character.animationpoint.X = -1; break; case 10: battle.effects.Add(new Charge(this.sound, battle, character.position.X, character.position.Y + 1)); break; case 26: this.targetNow = 1; this.frame = 0; break; } } } else { switch (this.targetNow) { case 1: this.animePoint = this.AnimeWideBO(this.frame); if (this.moveflame) { switch (this.frame) { case 2: this.ShakeStart(8, 8); this.sound.PlaySE(SoundEffect.shotwave); this.sound.PlaySE(SoundEffect.breakObject); AttackBase a = new SwordAttack(this.sound, battle, this.posi.X + 2 * this.UnionRebirth(character.union), this.posi.Y, character.union, this.Power(character), 3, this.element, false, false); battle.attacks.Add(this.Paralyze(a)); break; case 6: this.frame = 0; ++this.targetNow; break; } break; } break; case 2: this.animePoint = this.AnimeLongBO(this.frame); if (this.moveflame) { switch (this.frame) { case 2: this.ShakeStart(8, 8); this.sound.PlaySE(SoundEffect.shotwave); this.sound.PlaySE(SoundEffect.breakObject); AttackBase a = new FighterSword(this.sound, battle, this.posi.X + this.UnionRebirth(character.union), this.posi.Y, character.union, this.Power(character), 3, this.element); battle.attacks.Add(this.Paralyze(a)); break; case 12: this.frame = 0; ++this.targetNow; break; } break; } break; case 3: this.end = true; break; } } this.FlameControl(3); }
void Awake() { swordScript = GameObject.Find("Bat").GetComponent<SwordAttack>(); }
protected override void Moving() { switch (this.motion) { case HalfSoul.MOTION.neutral: if (this.moveflame) { ++this.waittime; } if (this.moveflame || this.attack) { this.animationpoint = this.AnimeNeutral(this.waittime); if (this.waittime >= 4 || this.attack) { this.waittime = 0; ++this.roopneutral; if (this.roopneutral >= 8 && this.parent.nowscene != SceneBattle.BATTLESCENE.end || this.attack) { this.roopneutral = 0; this.waittime = 0; this.motion = HalfSoul.MOTION.move; } } break; } break; case HalfSoul.MOTION.move: this.animationpoint = this.AnimeMove(this.waittime); if (this.moveflame) { switch (this.waittime) { case 0: if (this.attack) { this.MoveRandom(true, true); } else { this.MoveRandom(false, false); } if (this.position == this.positionre) { this.motion = !this.attack ? HalfSoul.MOTION.neutral : HalfSoul.MOTION.attack; this.waittime = 0; this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } break; case 3: this.position = this.positionre; this.PositionDirectSet(); break; case 5: this.motion = !this.attack ? HalfSoul.MOTION.neutral : HalfSoul.MOTION.attack; this.waittime = 0; this.frame = 0; this.roopneutral = 0; ++this.roopmove; break; } ++this.waittime; break; } break; case HalfSoul.MOTION.attack: this.animationpoint = this.AnimeAttack(this.waittime); if (this.moveflame) { switch (this.waittime) { case 5: this.sound.PlaySE(SoundEffect.sword); AttackBase attackBase1 = new SwordAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, 100, 2, this.element, false, false); attackBase1.invincibility = false; this.parent.attacks.Add(attackBase1); break; case 9: this.sound.PlaySE(SoundEffect.sword); AttackBase attackBase2 = new LanceAttack(this.sound, this.parent, this.position.X + this.UnionRebirth(this.union), this.position.Y, this.union, 100, 2, this.element, true); attackBase2.invincibility = false; this.parent.attacks.Add(attackBase2); break; case 20: this.motion = HalfSoul.MOTION.move; this.waittime = 0; this.attack = false; break; } ++this.waittime; break; } break; case HalfSoul.MOTION.lost: if (this.waittime < 4) { this.animationpoint = this.AnimeLost(this.waittime); if (this.waittime == 2) { this.nohit = true; } ++this.waittime; break; } break; case HalfSoul.MOTION.unlost: this.animationpoint = this.AnimeUnLost(this.waittime); if (this.waittime == 3) { this.nohit = false; this.waittime = 0; this.motion = HalfSoul.MOTION.neutral; } ++this.waittime; break; } this.FlameControl(4); }