public void DisengageEnemyNew(GameObject enemy, AttackBase attack)
		{
            CharacterStats component = enemy.GetComponent<CharacterStats>();
            if ((component != null) && !component.IsImmuneToEngagement && !IEModOptions.DisableEngagement) // added && (Mod_GameOptions_GameMode)GameState.Mode).DisableEngagement == 0
            {
                attack.IsDisengagementAttack = true;
                attack.Launch(enemy, -1);
                UIHealthstringManager.Instance.ShowNotice(GUIUtils.GetText(2150), enemy, 2.5f);
            }
            GameObject owner = this.StateManager.CurrentState.Owner;
            this.m_disengagementTrackers.Add(new AIController.DisengagementTracker(enemy, false));
            this.StopEngagement(enemy);
            if (this.m_stats != null)
            {
                this.m_stats.NotifyEngagementBreak(enemy);
            }
            this.EnemyBreaksEngagement(enemy);
            AIController aIController = enemy.GetComponent<AIController>();
            if (aIController)
            {
                GameEventArgs gameEventArg = new GameEventArgs()
                {
                    Type = GameEventType.MeleeEngageBroken,
                    GameObjectData = new GameObject[] { owner }
                };
                aIController.OnEvent(gameEventArg);
                aIController.EnemyBreaksEngagement(owner);
            }
		}
Example #2
0
		public void DisengageEnemyNew(GameObject enemy, AttackBase attack)
		{
			CharacterStats component = enemy.GetComponent<CharacterStats>();
			if ((component != null) && !component.ImmuneToEngagement && !IEModOptions.DisableEngagement) // added && (Mod_GameOptions_GameMode)GameState.Mode).DisableEngagement == 0
			{
				attack.IsDisengagementAttack = true;
				attack.Launch(enemy, -1);
			}
			GameObject owner = this.StateManager.CurrentState.Owner;
			this.m_disengagementTrackers.Add(new DisengagementTracker(enemy, false));
			this.StopEnagagement(enemy);
			if (this.m_stats != null)
			{
				this.m_stats.NotifyEngagementBreak(enemy);
			}
			this.EnemyBreaksEngagement(enemy);
			AIController controller = enemy.GetComponent<AIController>();
			if (controller != null)
			{
				GameEventArgs args = new GameEventArgs {
					Type = GameEventType.MeleeEngageBroken,
					GameObjectData = new GameObject[] { owner }
				};
				controller.OnEvent(args);
				controller.EnemyBreaksEngagement(owner);
			}
		}
Example #3
0
        public static void ApplySingleChangeToAttack(AttackBase attack, AbilityChange singleChange)
        {
            IEDebug.Log($"Applying change {singleChange.Type.ToString()} to {attack.name.ToString()}");

            try {
                AttackAOE aoe;

                switch (singleChange.Type)
                {
                case AbilityChange.ChangeType.Accuracy:
                    attack.AccuracyBonus = singleChange.GetValue <int>();
                    break;

                case AbilityChange.ChangeType.Range:
                    attack.AttackDistance = singleChange.GetValue <float>();
                    break;

                case AbilityChange.ChangeType.MinDamage:
                    attack.DamageData.Minimum = singleChange.GetValue <float>();
                    break;

                case AbilityChange.ChangeType.MaxDamage:
                    attack.DamageData.Maximum = singleChange.GetValue <float>();
                    break;

                case AbilityChange.ChangeType.DamageType:
                    attack.DamageData.Type = singleChange.GetValue <DamagePacket.DamageType>();
                    break;

                case AbilityChange.ChangeType.DefendedBy:
                    attack.DefendedBy = singleChange.GetValue <CharacterStats.DefenseType>();
                    break;

                case AbilityChange.ChangeType.DTBypass:
                    attack.DTBypass = singleChange.GetValue <float>();
                    break;

                case AbilityChange.ChangeType.Speed:
                    attack.AttackSpeed = singleChange.GetValue <AttackBase.AttackSpeedType>();
                    break;

                case AbilityChange.ChangeType.BlastRadius:
                    if (!(attack is AttackAOE))
                    {
                        throw new InvalidOperationException("Cannot change BlastRadius on a non-AOE attack");
                    }

                    aoe             = attack as AttackAOE;
                    aoe.BlastRadius = singleChange.GetValue <float>();

                    break;

                case AbilityChange.ChangeType.BlastAngle:
                    if (!(attack is AttackAOE))
                    {
                        throw new InvalidOperationException("Cannot change BlastAngle on a non-AOE attack");
                    }

                    aoe = attack as AttackAOE;
                    aoe.DamageAngleDegrees = singleChange.GetValue <float>();

                    break;

                case AbilityChange.ChangeType.StatusEffect:
                    AbilityChange.StatusEffectChange statusEffectData = singleChange.GetValue <AbilityChange.StatusEffectChange>();
                    if (attack.StatusEffects.Count <= statusEffectData.Index)
                    {
                        throw new InvalidOperationException($"Attempt to change Status Effect at Index {statusEffectData.Index}, but attack only contains {attack.StatusEffects.Count} status effects.");
                    }

                    if (statusEffectData.Magnitude.HasValue)
                    {
                        attack.StatusEffects[statusEffectData.Index].Value = statusEffectData.Magnitude.Value;
                    }
                    if (statusEffectData.Duration.HasValue)
                    {
                        attack.StatusEffects[statusEffectData.Index].Duration = statusEffectData.Duration.Value;
                    }

                    break;

                case AbilityChange.ChangeType.Affliction:
                    AbilityChange.AfflictionChange afflictionData = singleChange.GetValue <AbilityChange.AfflictionChange>();
                    if (attack.Afflictions.Count <= afflictionData.Index)
                    {
                        throw new InvalidOperationException($"Attempt to change Affliction at Index {afflictionData.Index}, but attack only contains {attack.Afflictions.Count} afflictions.");
                    }

                    attack.Afflictions[afflictionData.Index].Duration = afflictionData.Duration;

                    break;

                case AbilityChange.ChangeType.ExtraAOE:
                    ApplyChangesToAttack(attack.ExtraAOE, singleChange.GetValue <IEnumerable <AbilityChange> >());
                    break;

                default:
                    throw new InvalidOperationException("Unsupported type of change");
                }
            } catch (Exception ex)
            {
                IEDebug.Log($"Failed to apply change {singleChange.Type.ToString()} to {attack.name.ToString()}. Reason: {ex.ToString()}");
            }
        }
Example #4
0
        public SelectAttackPowerTarget(Actor self, string order, SupportPowerManager manager, string cursor, MouseButton button, AttackBase attack)
        {
            // Clear selection if using Left-Click Orders
            if (Game.Settings.Game.UseClassicMouseStyle)
            {
                manager.Self.World.Selection.Clear();
            }

            instance       = manager.GetPowersForActor(self).FirstOrDefault();
            this.manager   = manager;
            this.order     = order;
            this.cursor    = cursor;
            expectedButton = button;
            this.attack    = attack;
            cursorBlocked  = cursor + "-blocked";
        }
Example #5
0
 public RenderRangeCircle(Actor self)
 {
     this.self = self;
     attack    = self.Trait <AttackBase>();
 }
 /// <summary>
 /// 攻撃動作終了時にコールバックを受け取る
 /// </summary>
 /// <param name="atk_base">Atk base.</param>
 void OnAttackFinished(AttackBase atk_base)
 {
     currentAttack = null;
 }
        // PartyMemberAI
        public void UpdateNew()
        {
            if (this.m_mover != null && this.m_mover.AIController == null)
            {
                this.m_mover.AIController = this;
            }
            if (GameState.s_playerCharacter != null && base.gameObject == GameState.s_playerCharacter.gameObject && PartyMemberAI.DebugParty)
            {
                UIDebug.Instance.SetText("Party Debug", PartyMemberAI.GetPartyDebugOutput(), Color.cyan);
                UIDebug.Instance.SetTextPosition("Party Debug", 0.95f, 0.95f, UIWidget.Pivot.TopRight);
            }
            if (this.m_destinationCircleState != null)
            {
                if (base.StateManager.IsStateInStack(this.m_destinationCircleState))
                {
                    this.ShowDestination(this.m_destinationCirclePosition);
                }
                else
                {
                    this.m_destinationCircleState = null;
                    this.HideDestination();
                }
            }
            if (GameState.s_playerCharacter != null && GameState.s_playerCharacter.RotatingFormation && this.Selected)
            {
                this.ShowDestinationTarget(this.m_desiredFormationPosition);
            }
            else
            {
                this.HideDestinationTarget();
            }
            if (this.m_revealer != null)
            {
                this.m_revealer.WorldPos        = base.gameObject.transform.position;
                this.m_revealer.RequiresRefresh = false;
            }
            else
            {
                this.CreateFogRevealer();
            }
            if (GameState.Paused)
            {
                base.CheckForNullEngagements();
                if (this.m_ai != null)
                {
                    this.m_ai.Update();
                }
                base.DrawDebugText();
                return;
            }
            if (this.m_ai == null)
            {
                return;
            }
            if (GameState.Option.AutoPause.IsEventSet(AutoPauseOptions.PauseEvent.EnemySpotted))
            {
                this.UpdateEnemySpotted();
            }
            if (this.QueuedAbility != null && this.QueuedAbility.Ready)
            {
                AIState    currentState = this.m_ai.CurrentState;
                Consumable component    = this.QueuedAbility.GetComponent <Consumable>();
                if (component != null && component.Type == Consumable.ConsumableType.Ingestible)
                {
                    ConsumePotion consumePotion = this.m_ai.QueuedState as ConsumePotion;
                    if (!(currentState is ConsumePotion) && (consumePotion == null || currentState.Priority < 1))
                    {
                        ConsumePotion consumePotion2 = AIStateManager.StatePool.Allocate <ConsumePotion>();
                        base.StateManager.PushState(consumePotion2);
                        consumePotion2.Ability = this.QueuedAbility;
                        AttackBase primaryAttack = this.GetPrimaryAttack();
                        if (!(primaryAttack is AttackMelee) || !(primaryAttack as AttackMelee).Unarmed)
                        {
                            consumePotion2.HiddenObjects = primaryAttack.GetComponentsInChildren <Renderer>();
                        }
                    }
                }
                else
                {
                    Attack attack = currentState as Attack;
                    if (this.QueuedAbility.Passive || attack == null)
                    {
                        this.QueuedAbility.Activate(currentState.Owner);
                    }
                    else
                    {
                        Ability ability = AIStateManager.StatePool.Allocate <Ability>();
                        ability.QueuedAbility = this.QueuedAbility;
                        if (attack != null)
                        {
                            if (attack.CanCancel)
                            {
                                attack.OnCancel();
                                base.StateManager.PopCurrentState();
                                base.StateManager.PushState(ability);
                            }
                            else
                            {
                                base.StateManager.QueueStateAtTop(ability);
                            }
                        }
                        else
                        {
                            base.StateManager.PushState(ability);
                        }
                    }
                }
                this.QueuedAbility = null;
            }
            BaseUpdate();             // modified
            if (GameState.IsLoading || GameState.s_playerCharacter == null)
            {
                return;
            }
            if (this.m_alphaControl != null && this.m_alphaControl.Alpha < 1.401298E-45f)
            {
                this.m_alphaControl.Alpha = 1f;
            }
            if (this.m_mover != null && !GameState.InCombat)
            {
                var walk = false;                 // modified
                if (GameState.InStealthMode)
                {
                    // If FastSneak is not enabled we walk
                    if (!IEModOptions.FastSneak)
                    {
                        walk = true;
                    }
                    else
                    {
                        // if the fastSneak mod is active, then check if any enemies are spotted
                        // if so...we walk
                        for (int i = 0; i < PartyMemberAI.PartyMembers.Length; ++i)
                        {
                            var p = PartyMemberAI.PartyMembers[i];
                            if (p != null && p.m_enemySpotted)
                            {
                                walk = true;
                                break;
                            }
                        }
                    }
                }

                // walk mode overrides fast sneak mode
                if (Mod_NoEngagement_Player.WalkMode)
                {
                    walk = true;
                }

                float        num = (!walk) ? this.m_mover.GetRunSpeed() : this.m_mover.GetWalkSpeed();          // modified
                GameObject[] selectedPartyMembers = PartyMemberAI.SelectedPartyMembers;
                for (int i = 0; i < selectedPartyMembers.Length; i++)
                {
                    GameObject gameObject = selectedPartyMembers[i];
                    if (!(gameObject == null) && !(gameObject == base.gameObject))
                    {
                        Mover component2 = gameObject.GetComponent <Mover>();
                        float num2       = (!walk) ? component2.GetRunSpeed() : component2.GetWalkSpeed();                   // modified
                        if (num2 < num)
                        {
                            num = component2.DesiredSpeed;
                        }
                    }
                }
                if (num < this.m_mover.GetWalkSpeed() * 0.75f)
                {
                    num = this.m_mover.GetWalkSpeed();
                }
                this.m_mover.UseCustomSpeed(num);
            }
            if (this.m_suspicionDecayTimer > 0f)
            {
                this.m_suspicionDecayTimer -= Time.deltaTime;
            }
            if (this.m_suspicionDecayTimer <= 0f)
            {
                for (int j = this.m_detectingMe.Count - 1; j >= 0; j--)
                {
                    this.m_detectingMe[j].m_time -= (float)AttackData.Instance.StealthDecayRate * Time.deltaTime;
                    if (this.m_detectingMe[j].m_time <= 0f)
                    {
                        this.m_detectingMe.RemoveAt(j);
                    }
                }
            }
        }
Example #8
0
 void INotifyAiming.StartedAiming(Actor self, AttackBase attack)
 {
     aiming = true;
 }
Example #9
0
 private void HitCheck()
 {
     for (int index1 = 0; index1 < this.attacks.Count; ++index1)
     {
         AttackBase attack1 = this.attacks[index1];
         if (attack1.hitting && (!this.blackOut || attack1.blackOutObject) && !attack1.effectMode)
         {
             foreach (Player player in this.players)
             {
                 if (attack1.union != player.union && (!player.nohit && player.printplayer && (!player.invincibility || attack1.breakinvi) && attack1.HitCheck(player.position)))
                 {
                     attack1.HitEvent(player);
                 }
             }
             foreach (EnemyBase enemy in this.enemys)
             {
                 if (!enemy.nohit && (!enemy.invincibility || attack1.breakinvi))
                 {
                     if (attack1.HitCheck(enemy.position, enemy.union))
                     {
                         attack1.HitEvent(enemy);
                     }
                     if (attack1.rehit && attack1.HitCheck(enemy.positionre, enemy.union))
                     {
                         attack1.HitEvent(enemy);
                     }
                 }
             }
             if (attack1.parry)
             {
                 List <BustorShot> bustorShotList = new List <BustorShot>();
                 foreach (AttackBase attack2 in this.attacks)
                 {
                     if (attack2.hitting && (!object.Equals(attack1, attack2) && attack1.HitCheck(attack2.position) && attack1.HitCheck(attack2.position, attack2.union)))
                     {
                         this.sound.PlaySE(SoundEffect.damagezero);
                         this.effects.Add(new Guard(this.sound, this, attack2.position.X, attack2.position.Y, 2));
                         BustorShot bustorShot = new BustorShot(this.sound, this, attack2.position.X, attack2.position.Y, attack1.union, attack1.power, BustorShot.SHOT.reflect, attack1.Element, true, 0)
                         {
                             canCounter         = false,
                             breaking           = false,
                             invincibility      = attack1.invincibility,
                             invincibilitytime  = attack1.invincibilitytime,
                             invincibilitytimeA = attack1.invincibilitytimeA,
                         };
                         bustorShotList.Add(bustorShot);
                         attack2.flag = false;
                     }
                 }
                 foreach (AttackBase attackBase in bustorShotList)
                 {
                     this.attacks.Add(attackBase);
                 }
             }
             for (int index2 = 0; index2 < this.objects.Count; ++index2)
             {
                 if (!this.objects[index2].nohit && (this.objects[index2].unionhit || this.objects[index2].union != attack1.union) && (attack1.HitCheck(this.objects[index2].position) && !this.objects[index2].nohit))
                 {
                     attack1.HitEvent(this.objects[index2]);
                 }
             }
         }
         if (attack1.panelChange && !attack1.flag)
         {
             attack1.PanelChange();
         }
     }
 }
Example #10
0
    public override void DefaultMoves()
    {
        AttackBase bbalSmash = new AttackBase();

        bbalSmash.name     = "Baseball Smash";
        bbalSmash.power    = 12;
        bbalSmash.attkType = AttackBase.attackType.attack;
        bbalSmash.attkRng  = AttackBase.attackRange.single;
        moves.Add(bbalSmash);

        AttackBase heal = new AttackBase();

        heal.name     = "Heal";
        heal.spCost   = 4;
        heal.power    = 25;
        heal.attkType = AttackBase.attackType.heal;
        heal.attkRng  = AttackBase.attackRange.single;
        moves.Add(heal);



        /*
         *
         *
         *
         * AttackBase redfrenzy = new AttackBase();
         * redfrenzy.attkElement = AttackBase.attackElement.fire;
         * redfrenzy.attkRng = AttackBase.attackRange.all;
         * redfrenzy.attkType = AttackBase.attackType.magic;
         * redfrenzy.name = "Red Frenzy";
         * redfrenzy.spCost = 5;
         * moves.Add(redfrenzy);
         *
         *
         * AttackBase opt = new AttackBase();
         * opt.name = "Optimize";
         * opt.spCost = 9;
         * opt.power = 65;
         * opt.attkElement = AttackBase.attackElement.normal;
         * opt.attkRng = AttackBase.attackRange.all;
         * opt.attkType = AttackBase.attackType.heal;
         * moves.Add(opt);
         *
         * AttackBase incenerate = new AttackBase();
         * incenerate.attkElement = AttackBase.attackElement.fire;
         * incenerate.attkRng = AttackBase.attackRange.all;
         * incenerate.attkType = AttackBase.attackType.magic;
         * incenerate.name = "Incenerate";
         * incenerate.power = 45;
         * incenerate.spCost = 12;
         * moves.Add(incenerate);
         *
         * AttackBase mindsword = new AttackBase();
         * mindsword.attkElement = AttackBase.attackElement.light;
         * mindsword.attkType = AttackBase.attackType.magic;
         * mindsword.name = "Mind Sword";
         * mindsword.power = 11;
         * mindsword.spCost = 2;
         * moves.Add(mindsword);
         *
         * AttackBase trioattack = new AttackBase();
         * trioattack.attkElement = AttackBase.attackElement.normal;
         * trioattack.attkRng = AttackBase.attackRange.all;
         * trioattack.attkType = AttackBase.attackType.magic;
         * trioattack.name = "Trio Attack";
         * trioattack.power = 45;
         * trioattack.spCost = 7;
         * moves.Add(trioattack);
         *
         * AttackBase holystrike = new AttackBase();
         * holystrike.attkElement = AttackBase.attackElement.light;
         * holystrike.attkRng = AttackBase.attackRange.single;
         * holystrike.attkType = AttackBase.attackType.skill;
         * holystrike.name = "Holy Strike";
         * holystrike.power = 30;
         * holystrike.spCost = 6;
         * moves.Add(holystrike);
         *
         *
         *
         * AttackBase fireStrike = new AttackBase();
         * fireStrike.attkElement = AttackBase.attackElement.fire;
         * fireStrike.attkRng = AttackBase.attackRange.single;
         * fireStrike.attkType = AttackBase.attackType.skill;
         * fireStrike.name = "Fire Strike";
         * fireStrike.power = 25;
         * fireStrike.spCost = 4;
         * moves.Add(fireStrike);
         *
         */
    }
Example #11
0
    public override void Attack(BattleCharacter target, AttackBase move)
    {
        selectedAttack = move;
        if (selectedAttack.attkRng != AttackBase.attackRange.all)
        {
            targetChar = target;
        }
        else
        {
            targetChar = null;
        }
        battlehandler.BSM.battlelog("- " + this.name + " prefromed " + selectedAttack.name);

        if (move.name == "Baseball Smash")
        {
            redAnimation = animationRedler.bBallSmash;
            animations   = animationstate.attack;
        }

        if (move.name == "Double Strike")
        {
            redAnimation = animationRedler.doubleStrike;
            animations   = animationstate.attack;
        }

        if (move.name == "Flame Strike")
        {
            redAnimation = animationRedler.fireStrike;
            animations   = animationstate.attack;
        }

        if (move.name == "Smite")
        {
            redAnimation = animationRedler.smite;
            animations   = animationstate.attack;
        }

        if (move.name == "Ominous Strike")
        {
            redAnimation = animationRedler.holyBall;
            animations   = animationstate.attack;
        }

        if (move.name == "Trio Attack")
        {
            redAnimation = animationRedler.trioAttk;
            animations   = animationstate.attack;
        }

        if (move.name == "Heal")
        {
            redAnimation = animationRedler.Heal;
            animations   = animationstate.attack;
        }

        if (move.name == "Mind Sword")
        {
            redAnimation = animationRedler.mindSword;
            animations   = animationstate.attack;
        }

        if (move.name == "Red Frenzy")
        {
            redAnimation = animationRedler.red_frenzy;
            animations   = animationstate.attack;
        }

        if (move.name == "Incenerate")
        {
            redAnimation = animationRedler.incenerate;
            animations   = animationstate.attack;
        }

        if (move.name == "Optimize")
        {
            redAnimation = animationRedler.optimize;
            animations   = animationstate.attack;
        }
        moveSelector();
    }
Example #12
0
        public override void Dameged(AttackBase attack)
        {
            if (attack is Dummy)
            {
                return;
            }

            if (this.state == MOTION.Absorbing)
            {
                if (this.parent.blackOut && this.controller.blackoutAdaptChip == null && this.controller.preAdaptWaitTime == null)
                {
                    foreach (CharacterBase characterBase in this.parent.AllChara())
                    {
                        if (characterBase.number == parent.blackOutChips[0].userNum)
                        {
                            this.controller.preAdaptWaitTime = characterBase.waittime;
                        }
                    }

                    this.controller.blackoutAdaptChip = new DammyChip(this.sound);
                    var adaptText = ShanghaiEXE.Translate("Enemy.HeavenBarrierSpecial");
                    this.controller.blackoutAdaptChip.BlackOut(this, this.parent, adaptText, "");
                }

                if (this.parent.blackOut)
                {
                    if (!this.controller.controlledBarriers.Any(b => b.blackOutObject))
                    {
                        this.blackOutObject = true;

                        foreach (var b in this.controller.controlledBarriers)
                        {
                            if (b == this)
                            {
                                continue;
                            }

                            b.blackoutSimulhitPossible = true;
                        }
                    }
                }

                if (!this.parent.blackOut || this.blackOutObject || this.blackoutSimulhitPossible)
                {
                    var attackDamage = this.lastDamage;
                    if (attackDamage == -1)
                    {
                        attackDamage = attack.DamageMath(this);
                    }

                    var remainingDamage = this.controller.totalHp - this.controller.rawDamageTaken;
                    var cappedDamage    = Math.Min(attackDamage, remainingDamage);
                    this.controller.rawDamageTakenSinceLastUpdate += cappedDamage;

                    this.controller.unprocessedAttacks.Add(Tuple.Create(this, attack.Element, cappedDamage));
                }
                else if (this.parent.blackOut && !this.blackoutBuildupInterrupted)
                {
                    this.sound.PlaySE(SoundEffect.bound);

                    var effectiveEffect = new Elementhit(this.sound, this.parent, this.positionDirect, 1, this.position, ChipBase.ELEMENT.eleki);
                    effectiveEffect.blackOutObject = true;
                    this.parent.effects.Add(effectiveEffect);

                    this.invincibility     = true;
                    this.invincibilitytime = 1;
                    // alpha increases by 15 per tick, if not exact then overflows and wraps around
                    this.alfha = byte.MaxValue - (15 * 8);

                    // TODO: Effects
                    this.blackoutBuildupInterrupted = true;
                }

                this.lastDamage = -1;
            }
        }
 public WithAimAnimation(ActorInitializer init, WithAimAnimationInfo info)
     : base(info)
 {
     attack = init.Self.Trait <AttackBase>();
     wsb    = init.Self.TraitsImplementing <WithSpriteBody>().First(w => w.Info.Name == Info.Body);
 }
Example #14
0
        // PartyMemberAI
        public void UpdateNew()
        {
            if (this.m_mover != null && this.m_mover.AIController == null)
            {
                this.m_mover.AIController = this;
            }
            if (this.m_instructionTimer > 0f)
            {
                PartyMemberAI mInstructionTimer = this;
                mInstructionTimer.m_instructionTimer = mInstructionTimer.m_instructionTimer - Time.deltaTime;
            }
            if (this.m_instructions != null)
            {
                for (int i = 0; i < this.m_instructions.Count; i++)
                {
                    this.m_instructions[i].Update();
                }
            }
            if (GameState.s_playerCharacter != null && base.gameObject == GameState.s_playerCharacter.gameObject && PartyMemberAI.DebugParty)
            {
                UIDebug.Instance.SetText("Party Debug", PartyMemberAI.GetPartyDebugOutput(), Color.cyan);
                UIDebug.Instance.SetTextPosition("Party Debug", 0.95f, 0.95f, UIWidget.Pivot.TopRight);
            }
            if (this.m_destinationCircleState != null)
            {
                if (!base.StateManager.IsStateInStack(this.m_destinationCircleState))
                {
                    this.m_destinationCircleState = null;
                    this.HideDestination();
                }
                else
                {
                    this.ShowDestination(this.m_destinationCirclePosition);
                }
            }
            if (!(GameState.s_playerCharacter != null) || !GameState.s_playerCharacter.RotatingFormation || !this.Selected)
            {
                this.HideDestinationTarget();
            }
            else
            {
                this.ShowDestinationTarget(this.m_desiredFormationPosition);
            }
            if (this.m_revealer == null)
            {
                this.CreateFogRevealer();
            }
            else
            {
                this.m_revealer.WorldPos        = base.gameObject.transform.position;
                this.m_revealer.RequiresRefresh = false;
            }
            if (GameState.Paused)
            {
                base.CheckForNullEngagements();
                if (this.m_ai != null)
                {
                    this.m_ai.Update();
                }
                return;
            }
            if (this.m_ai == null)
            {
                return;
            }
            if (GameState.Option.AutoPause.IsEventSet(AutoPauseOptions.PauseEvent.EnemySpotted))
            {
                this.UpdateEnemySpotted();
            }
            if (this.QueuedAbility != null && this.QueuedAbility.Ready)
            {
                AIState    currentState = this.m_ai.CurrentState;
                Consumable component    = this.QueuedAbility.GetComponent <Consumable>();
                if (!(component != null) || !component.IsFoodDrugOrPotion)
                {
                    Attack         attack         = currentState as Attack;
                    TargetedAttack targetedAttack = currentState as TargetedAttack;
                    if (this.QueuedAbility.Passive || attack == null && targetedAttack == null)
                    {
                        this.QueuedAbility.Activate(currentState.Owner);
                    }
                    else if (targetedAttack == null || !this.QueuedAbility.UsePrimaryAttack && !this.QueuedAbility.UseFullAttack)
                    {
                        Ability queuedAbility = AIStateManager.StatePool.Allocate <Ability>();
                        queuedAbility.QueuedAbility = this.QueuedAbility;
                        if (attack == null)
                        {
                            base.StateManager.PushState(queuedAbility);
                        }
                        else if (!attack.CanCancel)
                        {
                            base.StateManager.QueueStateAtTop(queuedAbility);
                        }
                        else
                        {
                            attack.OnCancel();
                            base.StateManager.PopCurrentState();
                            base.StateManager.PushState(queuedAbility);
                        }
                    }
                }
                else
                {
                    ConsumePotion queuedState = this.m_ai.QueuedState as ConsumePotion;
                    if (!(currentState is ConsumePotion) && (queuedState == null || currentState.Priority < 1))
                    {
                        ConsumePotion animationVariation = AIStateManager.StatePool.Allocate <ConsumePotion>();
                        base.StateManager.PushState(animationVariation);
                        animationVariation.Ability          = this.QueuedAbility;
                        animationVariation.ConsumeAnimation = component.AnimationVariation;
                        AttackBase primaryAttack = this.GetPrimaryAttack();
                        if (!(primaryAttack is AttackMelee) || !(primaryAttack as AttackMelee).Unarmed)
                        {
                            animationVariation.HiddenObjects = primaryAttack.GetComponentsInChildren <Renderer>();
                        }
                    }
                }
                this.QueuedAbility = null;
            }
            BaseUpdate();
            if (GameState.IsLoading || GameState.s_playerCharacter == null)
            {
                return;
            }
            if (this.m_alphaControl != null && this.m_alphaControl.Alpha < 1.401298E-45f)
            {
                this.m_alphaControl.Alpha = 1f;
            }
            if (this.m_mover != null && !GameState.InCombat)
            {
                bool fastSneakActive = false;
                if (IEModOptions.FastSneak != IEModOptions.FastSneakOptions.Normal && !(mod_Player.WalkMode))
                {
                    bool canSeeEnemy = false;

                    if (IEModOptions.FastSneak == IEModOptions.FastSneakOptions.FastScoutingSingleLOS)
                    {
                        canSeeEnemy = this.m_enemySpotted;
                    }
                    else if (IEModOptions.FastSneak == IEModOptions.FastSneakOptions.FastScoutingAllLOS)
                    {
                        // if the fastSneak mod is active, then check if any enemies are spotted
                        // if so...we walk
                        for (int i = 0; i < PartyMemberAI.PartyMembers.Length; ++i)
                        {
                            var p = PartyMemberAI.PartyMembers[i];
                            if (p != null && p.m_enemySpotted)
                            {
                                canSeeEnemy = true;
                                break;
                            }
                        }
                    }
                    else
                    {
                        //Should never get here, but make default behavior to not override stealth
                        canSeeEnemy = true;
                    }

                    if (!canSeeEnemy)
                    {
                        fastSneakActive = true;
                    }
                }

                bool         flag                 = ((Stealth.IsInStealthMode(base.gameObject) && !fastSneakActive) || mod_Player.WalkMode);
                float        desiredSpeed         = (!flag ? this.m_mover.GetRunSpeed() : this.m_mover.GetWalkSpeed());
                GameObject[] selectedPartyMembers = PartyMemberAI.SelectedPartyMembers;
                for (int i = 0; i < (int)selectedPartyMembers.Length; i++)
                {
                    GameObject gameObject = selectedPartyMembers[i];
                    if (!(gameObject == null) && !(gameObject == base.gameObject) && flag == Stealth.IsInStealthMode(gameObject))
                    {
                        Mover mover = gameObject.GetComponent <Mover>();
                        if (((!Stealth.IsInStealthMode(gameObject) || fastSneakActive)  ? mover.GetRunSpeed() : mover.GetWalkSpeed()) < desiredSpeed)
                        {
                            desiredSpeed = mover.DesiredSpeed;
                        }
                    }
                }
                if (desiredSpeed < 1.5f)
                {
                    desiredSpeed = 2f;
                }
                this.m_mover.UseCustomSpeed(desiredSpeed);
            }
        }
    public override void Attack(BattleCharacter target, AttackBase move)
    {
        selectedAttack = move;
        targetChar     = target;

        battlehandler.BSM.battlelog("- " + this.name + " preformed " + selectedAttack.name + ".");
        if (move.name == "Wrench Whack")
        {
            blueAnimation = animationBlueler.wrenchSmash;
            animations    = animationstate.attack;
        }

        if (move.name == "Frost Strike")
        {
            blueAnimation = animationBlueler.froststrike;
            animations    = animationstate.attack;
        }

        if (move.name == "Restore")
        {
            blueAnimation = animationBlueler.Heal;
            animations    = animationstate.attack;
        }

        if (move.name == "Impulse")
        {
            blueAnimation = animationBlueler.impulse;
            animations    = animationstate.attack;
        }

        if (move.name == "Blue Frenzy")
        {
            blueAnimation = animationBlueler.blue_frenzy;
            animations    = animationstate.attack;
        }
        if (move.name == "Triple Strike")
        {
            blueAnimation = animationBlueler.triple_strike;
            animations    = animationstate.attack;
        }

        if (move.name == "Chill")
        {
            blueAnimation = animationBlueler.chill;
            animations    = animationstate.attack;
        }
        if (move.name == "Holy Strike")
        {
            blueAnimation = animationBlueler.holy_strike;
            animations    = animationstate.attack;
        }

        if (move.name == "Diamond Gleam")
        {
            blueAnimation = animationBlueler.diamond_gleam;
            animations    = animationstate.attack;
        }

        if (move.name == "Vitalize")
        {
            blueAnimation = animationBlueler.vitalize;
            animations    = animationstate.attack;
        }

        moveSelector();
    }
        public void CheckFire(Actor self, AttackBase attack, IMove move, IFacing facing, Target target)
        {
            if (FireDelay > 0) return;

            var limitedAmmo = self.TraitOrDefault<LimitedAmmo>();
            if (limitedAmmo != null && !limitedAmmo.HasAmmo())
                return;

            if (!Combat.IsInRange(self.CenterLocation, Info.Range, target)) return;
            if (Combat.IsInRange(self.CenterLocation, Info.MinRange, target)) return;

            if (!IsValidAgainst(self.World, target)) return;

            var barrel = Barrels[Burst % Barrels.Length];
            var destMove = target.IsActor ? target.Actor.TraitOrDefault<IMove>() : null;
            var turreted = self.TraitOrDefault<Turreted>();

            var args = new ProjectileArgs
            {
                weapon = Info,

                firedBy = self,
                target = target,

                src = (self.CenterLocation
                    + Combat.GetBarrelPosition(self, facing, Turret, barrel)).ToInt2(),
                srcAltitude = move != null ? move.Altitude : 0,
                dest = target.CenterLocation,
                destAltitude = destMove != null ? destMove.Altitude : 0,

                facing = barrel.Facing +
                    (turreted != null ? turreted.turretFacing :
                    facing != null ? facing.Facing : Util.GetFacing(target.CenterLocation - self.CenterLocation, 0)),

                firepowerModifier = self.TraitsImplementing<IFirepowerModifier>()
                     .Select(a => a.GetFirepowerModifier())
                     .Product()
            };

            attack.ScheduleDelayedAction( attack.FireDelay( self, target, self.Info.Traits.Get<AttackBaseInfo>() ), () =>
            {
                if (args.weapon.Projectile != null)
                {
                    var projectile = args.weapon.Projectile.Create(args);
                    if (projectile != null)
                        self.World.Add(projectile);

                    if (!string.IsNullOrEmpty(args.weapon.Report))
                        Sound.Play(args.weapon.Report + ".aud", self.CenterLocation);
                }
            });

            foreach (var na in self.TraitsImplementing<INotifyAttack>())
                na.Attacking(self, target);

            FiredShot();
        }
    new void Start()
    {
        transform.localRotation = Quaternion.Euler(0, 180, 0);
        baseExpToGive           = 32;
        expIncrementer          = 32;

        attackIncrementer       = 2;
        specialIncrementer      = 1;
        defenceIncrementer      = 2;
        healthIncrementer       = 3;
        intelligenceIncrementer = 3;

        weakness  = AttackBase.attackElement.ice;
        resistant = AttackBase.attackElement.fire;

        baseHealth        = 55;
        baseAttack        = 3;
        baseDefence       = 3;
        baseSpecialPoints = 15;
        baseIntelligence  = 3;

        base.Start();

        AttackBase redfrenzy = new AttackBase();

        redfrenzy.attkElement = AttackBase.attackElement.fire;
        redfrenzy.attkRng     = AttackBase.attackRange.all;
        redfrenzy.attkType    = AttackBase.attackType.magic;
        redfrenzy.name        = "Red Frenzy";
        redfrenzy.spCost      = 5;
        moves.Add(redfrenzy);


        AttackBase opt = new AttackBase();

        opt.name        = "Optimize";
        opt.spCost      = 9;
        opt.power       = 65;
        opt.attkElement = AttackBase.attackElement.normal;
        opt.attkRng     = AttackBase.attackRange.all;
        opt.attkType    = AttackBase.attackType.heal;
        moves.Add(opt);

        AttackBase incenerate = new AttackBase();

        incenerate.attkElement = AttackBase.attackElement.fire;
        incenerate.attkRng     = AttackBase.attackRange.all;
        incenerate.attkType    = AttackBase.attackType.magic;
        incenerate.name        = "Incenerate";
        incenerate.power       = 45;
        incenerate.spCost      = 12;
        moves.Add(incenerate);

        AttackBase mindsword = new AttackBase();

        mindsword.attkElement = AttackBase.attackElement.light;
        mindsword.attkType    = AttackBase.attackType.magic;
        mindsword.name        = "Mind Sword";
        mindsword.power       = 11;
        mindsword.spCost      = 2;
        moves.Add(mindsword);

        AttackBase trioattack = new AttackBase();

        trioattack.attkElement = AttackBase.attackElement.normal;
        trioattack.attkRng     = AttackBase.attackRange.all;
        trioattack.attkType    = AttackBase.attackType.magic;
        trioattack.name        = "Trio Attack";
        trioattack.power       = 45;
        trioattack.spCost      = 7;
        moves.Add(trioattack);

        AttackBase holystrike = new AttackBase();

        holystrike.attkElement = AttackBase.attackElement.light;
        holystrike.attkRng     = AttackBase.attackRange.single;
        holystrike.attkType    = AttackBase.attackType.skill;
        holystrike.name        = "Holy Strike";
        holystrike.power       = 30;
        holystrike.spCost      = 6;
        moves.Add(holystrike);



        AttackBase fireStrike = new AttackBase();

        fireStrike.attkElement = AttackBase.attackElement.fire;
        fireStrike.attkRng     = AttackBase.attackRange.single;
        fireStrike.attkType    = AttackBase.attackType.skill;
        fireStrike.name        = "Fire Strike";
        fireStrike.power       = 25;
        fireStrike.spCost      = 4;
        moves.Add(fireStrike);

        AttackBase bbalSmash = new AttackBase();

        bbalSmash.name     = "Baseball Smash";
        bbalSmash.power    = 12;
        bbalSmash.attkType = AttackBase.attackType.attack;
        moves.Add(bbalSmash);

        AttackBase heal = new AttackBase();

        heal.name     = "Heal";
        heal.spCost   = 4;
        heal.power    = 25;
        heal.attkType = AttackBase.attackType.heal;
        moves.Add(heal);

        AttackBase dblStrk = new AttackBase();

        dblStrk.name     = "Double Strike";
        dblStrk.power    = 11;
        dblStrk.attkType = AttackBase.attackType.attack;
        moves.Add(dblStrk);
    }
    new void Start()
    {
        weakness  = AttackBase.attackElement.shadow;
        resistant = AttackBase.attackElement.fire;

        moneyAmount    = 10;
        baseExpToGive  = 19;
        expIncrementer = 23;

        attackIncrementer       = 2;
        defenceIncrementer      = 4;
        healthIncrementer       = 3;
        specialIncrementer      = 2;
        intelligenceIncrementer = 5;

        baseSpecialPoints = 15;
        baseHealth        = 75;
        baseAttack        = 1;
        baseDefence       = 2;
        baseIntelligence  = 4;

        base.Start();


        AttackBase slash = new AttackBase();

        slash.name        = "Shoot Meteor";
        slash.power       = 10;
        slash.attkElement = AttackBase.attackElement.normal;
        slash.attkRng     = AttackBase.attackRange.single;
        slash.attkType    = AttackBase.attackType.magic;
        moves.Add(slash);

        AttackBase heal = new AttackBase();

        heal.name         = "Heal";
        heal.power        = 55;
        heal.spCost       = 7;
        heal.attkType     = AttackBase.attackType.heal;
        slash.attkElement = AttackBase.attackElement.normal;
        slash.attkRng     = AttackBase.attackRange.single;
        moves.Add(heal);

        if (level > 9)
        {
            AttackBase frost = new AttackBase();
            frost.name        = "Frost";
            frost.power       = 25;
            frost.attkType    = AttackBase.attackType.magic;
            frost.attkElement = AttackBase.attackElement.ice;
            frost.spCost      = 5;
            moves.Add(frost);
        }
        if (level > 15)
        {
            AttackBase osmosis = new AttackBase();
            osmosis.attkType    = AttackBase.attackType.magic;
            osmosis.attkElement = AttackBase.attackElement.ice;
            osmosis.attkRng     = AttackBase.attackRange.single;
            osmosis.spCost      = 2;
            osmosis.power       = 5;
            osmosis.name        = "Osmosis";
            moves.Add(osmosis);

            AttackBase mindsword = new AttackBase();
            mindsword.attkElement = AttackBase.attackElement.light;
            mindsword.attkType    = AttackBase.attackType.magic;
            mindsword.attkRng     = AttackBase.attackRange.single;
            mindsword.name        = "Mind Sword";
            mindsword.power       = 20;
            mindsword.spCost      = 6;
            moves.Add(mindsword);
        }
        if (level > 28)
        {
            AttackBase incenerate = new AttackBase();
            incenerate.attkElement = AttackBase.attackElement.fire;
            incenerate.attkRng     = AttackBase.attackRange.all;
            incenerate.attkType    = AttackBase.attackType.magic;
            incenerate.name        = "Incenerate";
            incenerate.power       = 45;
            incenerate.spCost      = 12;
            moves.Add(incenerate);

            AttackBase blizzard = new AttackBase();
            blizzard.power       = 50;
            blizzard.spCost      = 13;
            blizzard.attkElement = AttackBase.attackElement.ice;
            blizzard.attkRng     = AttackBase.attackRange.single;
            blizzard.attkType    = AttackBase.attackType.magic;
            blizzard.name        = "Blizzard";
            moves.Add(blizzard);
        }
    }
Example #19
0
 void INotifyAiming.StoppedAiming(Actor self, AttackBase ab)
 {
     UpdateSequence();
 }
Example #20
0
    public void ChangeBattleState(BattleState newState)
    {
        int value;

        nextBattleState = newState;
        switch (nextBattleState)
        {
        case BattleState.WAITING:
            break;

        case BattleState.YOUR_TURN:
            yourTurn();
            break;

        case BattleState.ANIMATION_ATTACK:
            //adicionar player animations
            if (enemies.Count > 0)
            {
                enemy = enemies [valueEnemy];
                if (ApplicationController.attackToInt(selectedAttack.nameAttack) == enemy.weakness)
                {
                    value = int.Parse(damageValue.text) * 5;
                }
                else
                {
                    value = int.Parse(damageValue.text);
                }
                enemy.setCurrentLife(enemy.getCurrentLife() - value);
                enemy.lifeSlider.value = enemy.getCurrentLife();
                if (enemy.getCurrentLife() <= 0)
                {
                    enemies.Remove(enemy);
                    DestroyObject(enemy.lifeSlider, 0);
                    DestroyObject(enemy.manaSlider, 0);
                    enemy.imageChar.enabled = false;
                    enemy.deadChar.enabled  = true;
                    DestroyObject(enemy, 0);
                    countTurn = enemies.Count - 1;
                    if (enemies.Count == 0)
                    {
                        ChangeBattleState(BattleState.WAITING);
                        ChangeGameState(GameState.WIN);
                    }
                }
                if (countAttack < playersAlive)
                {
                    countAttack = countAttack + 1;
                    ChangeBattleState(BattleState.YOUR_TURN);
                }
                else
                {
                    countAttack = 0;
                    ChangeBattleState(BattleState.ENEMY_TURN);
                }
            }
            else
            {
                ChangeBattleState(BattleState.WAITING);
                ChangeGameState(GameState.WIN);
            }
            enemyList.value = 0;
            valueEnemy      = 0;

            break;

        case BattleState.ENEMY_TURN:
            if (players.Count > 0 && enemies.Count > 0)
            {
                enemy          = enemies [countAttack];
                selectedAttack = enemy.attacks [0];
                if (ApplicationController.attackToInt(enemy.attacks [0].nameAttack) == player.weakness)
                {
                    value = int.Parse(selectedAttack.damageAttack.ToString()) * 5;
                }
                else
                {
                    value = int.Parse(selectedAttack.damageAttack.ToString());
                }
                player.setCurrentLife(player.getCurrentLife() - value);
                player.lifeSlider.value = player.getCurrentLife();
                if (player.getCurrentLife() <= 0)
                {
                    players.Remove(player);
                    DestroyObject(player.lifeSlider, 0);
                    DestroyObject(player.manaSlider, 0);
                    player.imageChar.enabled = false;
                    player.deadChar.enabled  = true;
                    DestroyObject(player, 0);
                    playersAlive = players.Count - 1;
                    if (players.Count == 0)
                    {
                        ChangeBattleState(BattleState.WAITING);
                        ChangeGameState(GameState.LOSE);
                    }
                }
                if (countAttack < countTurn)
                {
                    countAttack = countAttack + 1;
                    ChangeBattleState(BattleState.ENEMY_TURN);
                }
                else
                {
                    countAttack = 0;
                    ChangeBattleState(BattleState.YOUR_TURN);
                }
            }
            else if (enemies.Count > 0)
            {
                ChangeBattleState(BattleState.WAITING);
                ChangeGameState(GameState.WIN);
            }
            else if (players.Count == 0)
            {
                ChangeBattleState(BattleState.WAITING);
                ChangeGameState(GameState.LOSE);
            }
            break;
        }
    }
Example #21
0
 void INotifyAiming.StoppedAiming(Actor self, AttackBase attack)
 {
     aiming = false;
 }
    new void Start()
    {
        transform.rotation = Quaternion.Euler(0, 180, 0);

        moneyAmount   = 90;
        baseExpToGive = 0;

        attackIncrementer       = 8;
        defenceIncrementer      = 6;
        intelligenceIncrementer = 9;

        baseHealth        = 2600;
        baseAttack        = 5;
        baseDefence       = 3;
        baseIntelligence  = 5;
        baseSpecialPoints = 1000;

        base.Start();

        AttackBase swordSlash = new AttackBase();

        swordSlash.attkElement = AttackBase.attackElement.normal;
        swordSlash.attkRng     = AttackBase.attackRange.single;
        swordSlash.attkType    = AttackBase.attackType.attack;
        swordSlash.name        = "Sword Slash";
        swordSlash.power       = 25;
        moves.Add(swordSlash);

        AttackBase lightning = new AttackBase();

        lightning.attkElement = AttackBase.attackElement.electric;
        lightning.attkType    = AttackBase.attackType.magic;
        lightning.name        = "Lightning";
        lightning.power       = 40;
        lightning.spCost      = 10;
        moves.Add(lightning);

        AttackBase blizzard = new AttackBase();

        blizzard.power       = 50;
        blizzard.spCost      = 13;
        blizzard.attkElement = AttackBase.attackElement.ice;
        blizzard.attkRng     = AttackBase.attackRange.single;
        blizzard.attkType    = AttackBase.attackType.magic;
        blizzard.name        = "Blizzard";
        moves.Add(blizzard);

        AttackBase brutalBlow = new AttackBase();

        brutalBlow.attkElement = AttackBase.attackElement.shadow;
        brutalBlow.attkRng     = AttackBase.attackRange.single;
        brutalBlow.attkType    = AttackBase.attackType.skill;
        brutalBlow.name        = "Brutal Blow";
        brutalBlow.spCost      = 10;
        brutalBlow.power       = health / 3;
        moves.Add(brutalBlow);

        AttackBase blackhole = new AttackBase();

        blackhole.name        = "Black Hole";
        blackhole.spCost      = 7;
        blackhole.power       = 45;
        blackhole.attkElement = AttackBase.attackElement.shadow;
        blackhole.attkRng     = AttackBase.attackRange.all;
        blackhole.attkType    = AttackBase.attackType.magic;
        moves.Add(blackhole);

        AttackBase holystrike = new AttackBase();

        holystrike.attkElement = AttackBase.attackElement.light;
        holystrike.attkRng     = AttackBase.attackRange.single;
        holystrike.attkType    = AttackBase.attackType.skill;
        holystrike.name        = "Holy Strike";
        holystrike.power       = 30;
        holystrike.spCost      = 6;
        moves.Add(holystrike);

        AttackBase incenerate = new AttackBase();

        incenerate.attkElement = AttackBase.attackElement.fire;
        incenerate.attkRng     = AttackBase.attackRange.all;
        incenerate.attkType    = AttackBase.attackType.magic;
        incenerate.name        = "Incenerate";
        incenerate.power       = 45;
        incenerate.spCost      = 12;
        moves.Add(incenerate);

        AttackBase heal = new AttackBase();

        heal.attkElement = AttackBase.attackElement.normal;
        heal.attkRng     = AttackBase.attackRange.single;
        heal.attkType    = AttackBase.attackType.heal;
        heal.name        = "Heal";
        heal.power       = 300;
        heal.spCost      = 45;
        moves.Add(heal);
    }
 public AttackFacade(ActorBehaviour user)
 {
     this.user     = user;
     currentAttack = null;
 }
Example #24
0
 public CombatProperties(ScriptContext context, Actor self)
     : base(context, self)
 {
     move       = self.Trait <IMove>();
     attackBase = self.Trait <AttackBase>();
 }
        protected virtual Activity InnerTick(Actor self, AttackBase attack)
        {
            if (IsCanceled)
            {
                return(NextActivity);
            }

            var type = Target.Type;

            if (!Target.IsValidFor(self) || type == TargetType.FrozenActor)
            {
                return(NextActivity);
            }

            if (attack.Info.AttackRequiresEnteringCell && !positionable.CanEnterCell(Target.Actor.Location, null, false))
            {
                return(NextActivity);
            }

            // Drop the target if it moves under the shroud / fog.
            // HACK: This would otherwise break targeting frozen actors
            // The problem is that Shroud.IsTargetable returns false (as it should) for
            // frozen actors, but we do want to explicitly target the underlying actor here.
            if (!attack.Info.IgnoresVisibility && type == TargetType.Actor && !Target.Actor.Info.HasTraitInfo <FrozenUnderFogInfo>() && !self.Owner.CanTargetActor(Target.Actor))
            {
                return(NextActivity);
            }

            // Drop the target once none of the weapons are effective against it
            var armaments = attack.ChooseArmamentsForTarget(Target, forceAttack).ToList();

            if (armaments.Count == 0)
            {
                return(NextActivity);
            }

            // Update ranges
            minRange = armaments.Max(a => a.Weapon.MinRange);
            maxRange = armaments.Min(a => a.MaxRange());

            var pos    = self.CenterPosition;
            var mobile = move as Mobile;

            if (!Target.IsInRange(pos, maxRange) ||
                (minRange.Length != 0 && Target.IsInRange(pos, minRange)) ||
                (mobile != null && !mobile.CanInteractWithGroundLayer(self)))
            {
                // Try to move within range, drop the target otherwise
                if (move == null)
                {
                    return(NextActivity);
                }

                attackStatus |= AttackStatus.NeedsToMove;
                moveActivity  = ActivityUtils.SequenceActivities(move.MoveWithinRange(Target, minRange, maxRange), this);
                return(NextActivity);
            }

            var targetedPosition = attack.GetTargetPosition(pos, Target);
            var desiredFacing    = (targetedPosition - pos).Yaw.Facing;

            if (facing.Facing != desiredFacing)
            {
                attackStatus |= AttackStatus.NeedsToTurn;
                turnActivity  = ActivityUtils.SequenceActivities(new Turn(self, desiredFacing), this);
                return(NextActivity);
            }

            attackStatus |= AttackStatus.Attacking;
            attack.DoAttack(self, Target, armaments);

            return(this);
        }
 void INotifyCreated.Created(Actor self)
 {
     attack = self.Trait <AttackBase>();
 }
Example #27
0
        protected override void Created(Actor self)
        {
            attack = self.Trait <AttackBase>();

            base.Created(self);
        }
        protected virtual void UpdateNew()
        {
            if (this.CooldownType == GenericAbility.CooldownMode.PerEncounter && !GameState.InCombat && this.m_perEncounterResetTimer > 0f)
            {
                this.m_perEncounterResetTimer -= Time.deltaTime;
                if (this.m_perEncounterResetTimer <= 0f)
                {
                    this.m_cooldownCounter = 0;

                    this.m_perEncounterResetTimer = 0f;
                }
            }

            if (this.m_activated)
            {
                if (this.ClearsOnMovement && this.IsMoving)
                {
                    this.HideFromCombatLog = true;
                    this.Deactivate(this.m_owner);
                    return;
                }
                //MOD (Remove combat-only restrictions) - changed this condition:
                if (this.CombatOnly && !GameState.InCombat && !(IEModOptions.CombatOnlyMod))
                {
                    this.Deactivate(this.m_owner);
                    return;
                }
                if (this.NonCombatOnly && GameState.InCombat)
                {
                    this.Deactivate(this.m_owner);
                    return;
                }
            }
            if (!GameState.Paused)
            {
                if (this.m_statusEffectsNeeded && !this.m_statusEffectsActivated)
                {
                    this.ActivateStatusEffects();
                }
                else if (!this.m_statusEffectsNeeded && this.m_statusEffectsActivated)
                {
                    this.DeactivateStatusEffects();
                }
            }
            if (this.m_activated && !this.m_applied)
            {
                if (this.CanApply())
                {
                    if (this.m_target != null)
                    {
                        this.Apply(this.m_target);
                    }
                    else
                    {
                        this.Apply(this.m_targetPoint);
                    }
                }
                return;
            }
            if (!this.Passive && this.Modal)
            {
                bool flag = this.m_ownerHealth && (this.m_ownerHealth.Dead || this.m_ownerHealth.Unconscious);
                if (this.m_activatedLaunching)
                {
                    if (flag || !this.m_UITriggered)
                    {
                        this.m_activatedLaunching = false;
                        this.m_rez_modal_cooldown = 5f;
                    }
                    else if (this.m_UITriggered && this.CombatOnly && GameState.InCombat && !this.m_activated && this.m_rez_modal_cooldown <= 0f)
                    {
                        PartyMemberAI component = this.m_owner.GetComponent <PartyMemberAI>();
                        if (component)
                        {
                            Ability ability = component.StateManager.FindState(typeof(Ability)) as Ability;
                            if (ability == null || ability.QueuedAbility != this)
                            {
                                this.m_activatedLaunching = false;
                            }
                        }
                        else
                        {
                            this.m_activatedLaunching = false;
                        }
                    }
                    else if (this.m_UITriggered && this.NonCombatOnly && !GameState.InCombat && !this.m_activated && this.m_rez_modal_cooldown <= 0f)
                    {
                        PartyMemberAI component2 = this.m_owner.GetComponent <PartyMemberAI>();
                        if (component2)
                        {
                            Ability ability2 = component2.StateManager.FindState(typeof(Ability)) as Ability;
                            if (ability2 == null || ability2.QueuedAbility != this)
                            {
                                this.m_activatedLaunching = false;
                            }
                        }
                        else
                        {
                            this.m_activatedLaunching = false;
                        }
                    }
                    else if (this.m_rez_modal_cooldown > 0f)
                    {
                        this.m_rez_modal_cooldown -= Time.deltaTime;
                    }
                }
                if (this.m_activated && this.CombatOnly && flag)
                {
                    this.Deactivate(this.m_owner);
                    this.m_activatedLaunching = false;
                }
                if (!GameState.Paused && this.m_ownerPartyAI != null && this.m_ownerPartyAI.gameObject.activeInHierarchy && this.m_UITriggered != (this.m_activated || this.m_activatedLaunching))
                {
                    if (this.m_activated)
                    {
                        this.Deactivate(this.m_owner);
                    }
                    else if (this.m_ownerPartyAI != null && this.m_ownerPartyAI.QueuedAbility == this)
                    {
                        this.m_ownerPartyAI.QueuedAbility = null;
                    }
                    else if (this.m_UITriggered && !flag)
                    {
                        if (this.Ready)
                        {
                            this.LaunchAttack(base.gameObject, false, null, null, null);
                        }
                    }
                    else
                    {
                        this.m_rez_modal_cooldown = 5f;
                        this.m_activatedLaunching = false;
                    }
                }
            }
            else if (!this.Passive && this.m_UITriggered)
            {
                this.m_UITriggered = false;
                if (this.m_ownerPartyAI != null && this.m_ownerPartyAI.Selected)
                {
                    if (this.TriggerOnHit)
                    {
                        this.m_activated = true;
                        return;
                    }
                    if (this.UsePrimaryAttack || this.UseFullAttack)
                    {
                        Equipment component3 = this.m_owner.GetComponent <Equipment>();
                        if (component3 != null)
                        {
                            AttackBase primaryAttack = component3.PrimaryAttack;
                            if (primaryAttack != null && this.m_ownerStats != null)
                            {
                                GenericAbility component4 = base.gameObject.GetComponent <GenericAbility>();
                                AttackBase     component5 = base.gameObject.GetComponent <AttackBase>();
                                if (this.m_attackBase != null)
                                {
                                    StatusEffect[]     array = new StatusEffect[1];
                                    StatusEffectParams statusEffectParams = new StatusEffectParams();
                                    statusEffectParams.AffectsStat  = StatusEffect.ModifiedStat.ApplyAttackEffects;
                                    statusEffectParams.AttackPrefab = this.m_attackBase;
                                    statusEffectParams.OneHitUse    = true;
                                    GenericAbility.AbilityType abType = GenericAbility.AbilityType.Ability;
                                    if (this is GenericSpell)
                                    {
                                        abType = GenericAbility.AbilityType.Spell;
                                    }
                                    array[0] = StatusEffect.Create(this.m_owner, this, statusEffectParams, abType, null, true);
                                    if (this.m_attackBase.UseAttackVariationOnFullAttack && this.UseFullAttack)
                                    {
                                        this.LaunchAttack(primaryAttack.gameObject, this.UseFullAttack, component4, array, component5, this.m_attackBase.AttackVariation);
                                    }
                                    else
                                    {
                                        this.LaunchAttack(primaryAttack.gameObject, this.UseFullAttack, component4, array, component5);
                                    }
                                }
                                else
                                {
                                    this.LaunchAttack(primaryAttack.gameObject, this.UseFullAttack, component4, null, component5);
                                }
                            }
                        }
                    }
                    else
                    {
                        this.LaunchAttack(base.gameObject, false, null, null, null);
                    }
                }
            }
            else if (this.m_activated && this.m_applied && !this.Passive && !this.Modal && !this.m_permanent && !this.UseFullAttack && !this.UsePrimaryAttack && (this.m_attackBase == null || this.AttackComplete))
            {
                this.m_activated          = false;
                this.m_activatedLaunching = false;
                this.m_applied            = false;
                this.OnInactive();
            }
            if (this.IsTriggeredPassive)
            {
                if (this.EffectTriggeredThisFrame)
                {
                    if (this.m_owner && FogOfWar.PointVisibleInFog(this.m_owner.transform.position))
                    {
                        this.ReportActivation();
                    }
                    this.EffectTriggeredThisFrame = false;
                }
                if (this.EffectUntriggeredThisFrame)
                {
                    if (this.m_owner && FogOfWar.PointVisibleInFog(this.m_owner.transform.position))
                    {
                        this.ReportDeactivation();
                    }
                    this.EffectUntriggeredThisFrame = false;
                }
            }
        }
    new void Start()
    {
        moneyAmount   = 5;
        baseExpToGive = 15;

        resistant = AttackBase.attackElement.electric;
        weakness  = AttackBase.attackElement.ice;

        expIncrementer          = 9;
        attackIncrementer       = 3;
        defenceIncrementer      = 3;
        healthIncrementer       = 4;
        intelligenceIncrementer = 4;

        baseHealth        = 35;
        baseAttack        = 3;
        baseDefence       = 3;
        baseIntelligence  = 3;
        baseSpecialPoints = 16;

        base.Start();

        AttackBase slash = new AttackBase();

        slash.name  = "Slash";
        slash.power = 7;
        moves.Add(slash);

        AttackBase fireStrike = new AttackBase();

        fireStrike.attkElement = AttackBase.attackElement.fire;
        fireStrike.attkRng     = AttackBase.attackRange.single;
        fireStrike.attkType    = AttackBase.attackType.skill;
        fireStrike.name        = "Fire Strike";
        fireStrike.power       = 25;
        fireStrike.spCost      = 4;
        moves.Add(fireStrike);

        AttackBase mindsword = new AttackBase();

        mindsword.attkElement = AttackBase.attackElement.light;
        mindsword.attkType    = AttackBase.attackType.magic;
        mindsword.name        = "Mind Sword";
        mindsword.power       = 15;
        mindsword.spCost      = 2;
        moves.Add(mindsword);

        if (level > 11)
        {
            AttackBase smite = new AttackBase();
            smite.attkElement = AttackBase.attackElement.shadow;
            smite.attkType    = AttackBase.attackType.skill;
            smite.name        = "Smite";
            smite.power       = 20;
            smite.spCost      = 3;
            moves.Add(smite);

            AttackBase impulse = new AttackBase();
            impulse.attkElement = AttackBase.attackElement.electric;
            impulse.attkRng     = AttackBase.attackRange.single;
            impulse.attkType    = AttackBase.attackType.magic;
            impulse.name        = "Impulse";
            impulse.spCost      = 5;
            moves.Add(impulse);
        }
    }
Example #30
0
        public override void Action(CharacterBase character, SceneBattle battle)
        {
            if (!this.BlackOut(character, battle, this.name, this.Power(character).ToString()))
            {
                return;
            }
            switch (this.motion)
            {
            case MasterStyle.MOTION._0_setup:
                switch (character.waittime)
                {
                case 2:
                    character.animationpoint = new Point(1, 0);
                    break;

                case 4:
                    character.animationpoint = new Point(2, 0);
                    break;

                case 6:
                    character.animationpoint = new Point(3, 0);
                    break;

                case 7:
                    character.animationpoint = new Point(99, 0);
                    break;

                case 10:
                    this.startPosition       = character.position;
                    character.animationpoint = new Point(-1, 0);
                    character.waittime       = 0;
                    this.motion = MasterStyle.MOTION._1_start;
                    for (int index = 0; index < this.tryPosition.Length; ++index)
                    {
                        this.tryPosition[index] = character.positionDirect;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._1_start:
                switch (character.waittime)
                {
                case 1:
                    this.sound.PlaySE(SoundEffect.pikin);
                    break;

                case 30:
                    this.sound.PlaySE(SoundEffect.dark);
                    break;

                case 70:
                    int index1 = 0;
                    while (index1 < 3)
                    {
                        foreach (CharacterBase characterBase in battle.AllChara())
                        {
                            if (!(characterBase is DammyEnemy) && characterBase.union == character.UnionEnemy)
                            {
                                if (index1 + 3 < this.attackPosition.Length)
                                {
                                    this.attackPosition[index1]     = characterBase.position;
                                    this.attackPosition[index1 + 3] = characterBase.position;
                                    ++index1;
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                    this.NextMotion(-1, 0, character);
                    this.atackEndFlame = 28;
                    break;
                }
                if (this.r < 24 && character.waittime > 30)
                {
                    ++this.r;
                    this.angle += 0.05;
                    for (int index2 = 0; index2 < this.tryPosition.Length; ++index2)
                    {
                        this.tryPosition[index2]    = character.positionDirect;
                        this.tryPosition[index2].X += r * (float)Math.Cos(this.angle - 360 * index2);
                        this.tryPosition[index2].Y -= r * (float)Math.Sin(this.angle - 360 * index2);
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._2_LeafFighter:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 3;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    break;

                case 14:
                    this.animePoint.X = 2;
                    break;

                case 16:
                    this.animePoint.X = 3;
                    this.sound.PlaySE(SoundEffect.lance);
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[0].X, this.attackPosition[0].Y, character.union, this.Power(character), 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.leaf;
                    this.attack.hitrange.X = 1;
                    this.attack.breaking   = true;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.NextMotion(1, 1, character);
                        this.atackEndFlame = 26;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._3_ElekiShinobi:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 1;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    this.sound.PlaySE(SoundEffect.sword);
                    this.effectattack         = new SwordAttack(this.sound, battle, this.attackPosition[1].X, this.attackPosition[1].Y, character.union, 0, 3, ChipBase.ELEMENT.eleki, false, false);
                    this.effectattack.hitting = false;
                    this.effectattack.rebirth = this.attackRevers;
                    this.effectattack.PositionDirectSet();
                    battle.attacks.Add(this.effectattack);
                    break;

                case 14:
                    this.animePoint.X = 2;
                    break;

                case 16:
                    this.animePoint.X      = 3;
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[1].X, this.attackPosition[1].Y - 1, character.union, this.Power(character), 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.eleki;
                    this.attack.hitrange.Y = 3;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;

                case 18:
                    this.animePoint.X = 4;
                    break;

                case 20:
                    this.animePoint.X = 5;
                    break;

                case 22:
                    this.animePoint.X = 6;
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.NextMotion(-2, 2, character);
                        this.atackEndFlame = 32;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._4_PoisonWing:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 1;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    this.sound.PlaySE(SoundEffect.shoot);
                    break;

                case 14:
                    this.animePoint.X = 2;
                    break;

                case 16:
                    this.animePoint.X = 3;
                    this.effectattack = new NSAttack.Storm(this.sound, battle, this.attackPosition[2].X, this.attackPosition[2].Y, character.union, this.Power(character) / 4, 4, ChipBase.ELEMENT.poison);
                    battle.attacks.Add(this.effectattack);
                    break;

                case 18:
                    this.animePoint.X = 4;
                    break;

                case 20:
                    this.animePoint.X = 5;
                    break;

                case 22:
                    this.animePoint.X = 6;
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.NextMotion(1, 3, character);
                        this.atackEndFlame = 40;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._5_EarthGaia:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 3;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    break;

                case 14:
                    this.animePoint.X = 2;
                    break;

                case 16:
                    this.animePoint.X = 3;
                    this.sound.PlaySE(SoundEffect.drill2);
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[3].X, this.attackPosition[3].Y, character.union, this.Power(character) / 4, 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.earth;
                    this.attack.hitrange.X = 1;
                    this.attack.breaking   = true;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;

                case 19:
                    ++this.subAnime;
                    break;

                case 22:
                    ++this.subAnime;
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[3].X, this.attackPosition[3].Y, character.union, this.Power(character) / 4, 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.earth;
                    this.attack.hitrange.X = 1;
                    this.attack.breaking   = true;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;

                case 25:
                    this.subAnime = 0;
                    break;

                case 28:
                    ++this.subAnime;
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[3].X, this.attackPosition[3].Y, character.union, this.Power(character) / 4, 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.earth;
                    this.attack.hitrange.X = 1;
                    this.attack.breaking   = true;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;

                case 31:
                    ++this.subAnime;
                    break;

                case 34:
                    ++this.subAnime;
                    this.attack            = new BombAttack(this.sound, battle, this.attackPosition[3].X, this.attackPosition[3].Y, character.union, this.Power(character) / 4, 1, ChipBase.ELEMENT.normal);
                    this.attack.element    = ChipBase.ELEMENT.earth;
                    this.attack.hitrange.X = 1;
                    this.attack.breaking   = true;
                    this.attack.rebirth    = this.attackRevers;
                    battle.attacks.Add(attack);
                    break;

                case 37:
                    this.subAnime = 0;
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.NextMotion(-2, 4, character);
                        this.atackEndFlame = 24;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._6_HeatDoctor:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 6;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    break;

                case 14:
                    this.animePoint.X = 2;
                    this.sound.PlaySE(SoundEffect.chain);
                    this.effectattack = new InjectBullet(this.sound, battle, this.attackPosition[4].X - 2 * (this.attackRevers ? -1 : 1), this.attackPosition[4].Y, character.union, this.Power(character), this.texname[4], ChipBase.ELEMENT.heat);
                    this.effectattack.badstatus[1] = false;
                    this.effectattack.rebirth      = this.attackRevers;
                    battle.attacks.Add(this.effectattack);
                    break;

                case 16:
                    this.animePoint.X = 3;
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.NextMotion(1, 5, character);
                        this.atackEndFlame = 42;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._7_AquaWhith:
                switch (character.waittime)
                {
                case 2:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 3;
                    break;

                case 4:
                    this.animePoint.X = 2;
                    break;

                case 6:
                    this.animePoint.X = 1;
                    break;

                case 8:
                    this.animePoint.X = 0;
                    break;

                case 10:
                    this.animePoint.Y = 6;
                    break;

                case 12:
                    this.animePoint.X = 1;
                    break;

                case 14:
                    this.animePoint.X = 2;
                    break;

                case 16:
                    this.animePoint.X = 3;
                    break;

                case 18:
                    this.animePoint.X = 4;
                    break;

                case 20:
                    this.animePoint.X = 5;
                    break;

                case 22:
                    this.animePoint.X = 6;
                    break;

                case 24:
                    this.sound.PlaySE(SoundEffect.fire);
                    this.effectattack         = new ElementFire(this.sound, battle, this.attackPosition[5].X, this.attackPosition[5].Y, character.union, this.Power(character), ChipBase.ELEMENT.aqua, false, 0);
                    this.effectattack.rebirth = this.attackRevers;
                    this.effectattack.PositionDirectSet();
                    this.effectattack.invincibility = false;
                    battle.attacks.Add(this.effectattack);
                    break;

                case 28:
                    this.sound.PlaySE(SoundEffect.fire);
                    this.effectattack         = new ElementFire(this.sound, battle, this.attackPosition[5].X + (this.attackRevers ? -1 : 1), this.attackPosition[5].Y, character.union, this.Power(character), ChipBase.ELEMENT.aqua, false, 0);
                    this.effectattack.rebirth = this.attackRevers;
                    this.effectattack.PositionDirectSet();
                    this.effectattack.invincibility = false;
                    battle.attacks.Add(this.effectattack);
                    break;

                case 32:
                    this.sound.PlaySE(SoundEffect.fire);
                    this.effectattack         = new ElementFire(this.sound, battle, this.attackPosition[5].X + 2 * (this.attackRevers ? -1 : 1), this.attackPosition[5].Y, character.union, this.Power(character), ChipBase.ELEMENT.aqua, false, 0);
                    this.effectattack.rebirth = this.attackRevers;
                    this.effectattack.PositionDirectSet();
                    this.effectattack.invincibility = false;
                    battle.attacks.Add(this.effectattack);
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 10)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                        ++this.motion;
                        character.waittime = 0;
                        this.atackEndFlame = 180;
                        character.position = this.startPosition;
                    }
                    break;
                }
                break;

            case MasterStyle.MOTION._8_Finish:
                switch (character.waittime)
                {
                case 4:
                    Charge charge1 = new Charge(this.sound, battle, 0, 0);
                    charge1.positionDirect = new Vector2(this.tryPosition[0].X, this.tryPosition[0].Y + 16f);
                    battle.effects.Add(charge1);
                    Charge charge2 = new Charge(this.sound, battle, 0, 0);
                    charge2.positionDirect = new Vector2(this.tryPosition[1].X, this.tryPosition[1].Y + 16f);
                    battle.effects.Add(charge2);
                    Charge charge3 = new Charge(this.sound, battle, 0, 0);
                    charge3.positionDirect = new Vector2(this.tryPosition[2].X, this.tryPosition[2].Y + 16f);
                    battle.effects.Add(charge3);
                    break;

                case 54:
                    this.animePoint.Y = 1;
                    break;

                case 56:
                    this.animePoint.X = 1;
                    break;

                case 58:
                    this.animePoint.X = 2;
                    break;

                case 60:
                    this.animePoint.X = 3;
                    BombAttack bombAttack = new BombAttack(this.sound, battle, character.union == Panel.COLOR.blue ? 5 : 0, 0, character.union, this.Power(character), 1, ChipBase.ELEMENT.normal);
                    bombAttack.hitrange      = new Point(6, 3);
                    bombAttack.breaking      = true;
                    bombAttack.throughObject = true;
                    battle.attacks.Add(bombAttack);
                    this.sound.PlaySE(SoundEffect.bombbig);
                    this.ShakeStart(4, 90);
                    int x = Eriabash.SteelX(character, battle);
                    battle.effects.Add(new RandomBomber(this.sound, battle, Bomber.BOMBERTYPE.flashbomber, 2, new Point(x, 0), new Point(6, 2), character.union, 36));
                    break;

                case 180:
                    this.animePoint.Y = 0;
                    this.animePoint.X = 0;
                    break;
                }
                if (character.waittime >= this.atackEndFlame)
                {
                    if (character.waittime == this.atackEndFlame)
                    {
                        this.animePoint.Y = 0;
                        this.animePoint.X = 0;
                    }
                    else if (character.waittime == this.atackEndFlame + 2)
                    {
                        this.animePoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 4)
                    {
                        this.animePoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 6)
                    {
                        this.animePoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 8)
                    {
                        this.animePoint.X = -1;
                    }
                    else if (character.waittime == this.atackEndFlame + 38)
                    {
                        character.animationpoint.Y = 0;
                        character.animationpoint.X = 3;
                    }
                    else if (character.waittime == this.atackEndFlame + 40)
                    {
                        character.animationpoint.X = 2;
                    }
                    else if (character.waittime == this.atackEndFlame + 42)
                    {
                        character.animationpoint.X = 1;
                    }
                    else if (character.waittime == this.atackEndFlame + 44)
                    {
                        character.animationpoint.X = 0;
                    }
                    else if (character.waittime > this.atackEndFlame + 44 && this.BlackOutEnd(character, battle))
                    {
                        base.Action(character, battle);
                    }
                    break;
                }
                break;
            }
        }
 public void AddAttack(AttackBase attack)
 {
     _skillList.Add(attack);
     _AddTime += attack.AddElapsedTime;
 }
 public GeneralCombatProperties(ScriptContext context, Actor self)
     : base(context, self)
 {
     attackBase = self.Trait <AttackBase>();
 }
Example #33
0
			public AttackOrderTargeter(AttackBase ab, string order, int priority, bool negativeDamage)
			{
				this.ab = ab;
				this.OrderID = order;
				this.OrderPriority = priority;
				this.negativeDamage = negativeDamage;
			}
Example #34
0
        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.moveflame)
            {
                if (this.targetNow < 0)
                {
                    this.animePoint = this.Anime(this.frame);
                    switch (this.frame)
                    {
                    case 1:
                        this.posi = character.position;
                        character.animationpoint.X = -1;
                        if (character.StandPanel.state == Panel.PANEL._grass)
                        {
                            this.beast  = true;
                            this.power *= 2;
                            this.sound.PlaySE(SoundEffect.docking);
                        }
                        this.sound.PlaySE(SoundEffect.warp);
                        foreach (CharacterBase characterBase in battle.AllChara())
                        {
                            if (characterBase.union == character.UnionEnemy)
                            {
                                Point position = characterBase.position;
                                position.X -= this.UnionRebirth(character.union);
                                if (character.InAreaCheck(position) && ((character.NoObject(position) || position == character.position) && !battle.panel[position.X, position.Y].Hole && (!(characterBase is DammyEnemy) || !characterBase.nohit) && character.InAreaCheck(character.position)))
                                {
                                    this.target.Add(position);
                                }
                            }
                        }
                        break;

                    case 10:
                        this.frame = 0;
                        ++this.targetNow;
                        if (this.targetNow >= this.target.Count)
                        {
                            this.end = true;
                            break;
                        }
                        this.posi = this.target[this.targetNow];
                        break;
                    }
                }
                else
                {
                    this.animePoint = this.targetNow % 2 != 1 ? (this.beast ? this.AnimeWideBO(this.frame) : this.AnimeWide(this.frame)) : (this.beast ? this.AnimeLongBO(this.frame) : this.AnimeLong(this.frame));
                    switch (this.frame)
                    {
                    case 9:
                        this.sound.PlaySE(SoundEffect.shotwave);
                        AttackBase a = this.beast ? new SwordAttack(this.sound, battle, this.posi.X + this.UnionRebirth(character.union), this.posi.Y, character.union, this.Power(character), 3, this.element, false, false) : (AttackBase) new KnifeAttack(this.sound, battle, this.posi.X + this.UnionRebirth(character.union), this.posi.Y, character.union, this.Power(character), 3, this.element, false);
                        battle.attacks.Add(this.Paralyze(a));
                        break;

                    case 12:
                        this.frame = 0;
                        ++this.targetNow;
                        if (this.targetNow >= this.target.Count)
                        {
                            this.end = true;
                            break;
                        }
                        this.posi = this.target[this.targetNow];
                        break;
                    }
                }
            }
            this.FlameControl(3);
        }