Beispiel #1
0
        public virtual void TransitionToLargeFlow(ReactionEffectEvent reaction_event)
        {
            // force switch
            FlowStartActionState fs = Combatant.GetActionState <FlowStartActionState>().SetHeight(FlowActionState.eHeightType.LARGE) as FlowStartActionState;

            SwitchState(fs);
        }
Beispiel #2
0
        public override void TransitionToLargeFlow(ReactionEffectEvent reaction_event)
        {
            IsEnd = true;

            FlowStartActionState next = Combatant.GetActionState <FlowStartActionState>().SetHeight(FlowActionState.eHeightType.LARGE) as FlowStartActionState;

            SwitchState(next);
        }
Beispiel #3
0
        public override void Init(Combatant combatant, CombatEvent combat_event)
        {
            //Debug.Assert(combat_event is ReactionEffectEvent, "invalid event type");

            base.Init(combatant, combat_event);

            ReactionEvent = combat_event as ReactionEffectEvent;
        }
Beispiel #4
0
        public override void TransitionToLittleFlow(ReactionEffectEvent reaction_event)
        {
            IsEnd = true;

            FlowUpActionState fu = Combatant.GetActionState <FlowUpActionState>().SetHeight(FlowActionState.eHeightType.LITTLE) as FlowUpActionState;

            SwitchState(fu);
        }
Beispiel #5
0
        public int GetHitTargetCount()
        {
            int cnt = 0;
            int len = m_children.Count;

            for (int i = 0; i < len; i++)
            {
                CombatEffectEvent effect = m_children[i] as CombatEffectEvent;
                if (effect.EffectType != eCombatEffectType.REACTION)
                {
                    continue;
                }

                ReactionEffectEvent reaction = effect as ReactionEffectEvent;
                cnt += reaction.IsMiss ? 0 : 1;
            }
            return(cnt);
        }
Beispiel #6
0
        public void SetHitTimes(int times)
        {
            m_totalHitTimes = times;
            m_hitTimes      = times;

            int len = m_children.Count;

            for (int i = 0; i < len; i++)
            {
                CombatEffectEvent effect = m_children[i] as CombatEffectEvent;
                if (effect.EffectType != eCombatEffectType.REACTION)
                {
                    continue;
                }

                ReactionEffectEvent reaction = effect as ReactionEffectEvent;
                reaction.TotalTimes = m_hitTimes;
                reaction.Times      = 0;
            }
        }
Beispiel #7
0
        public CombatEffectEvent Split(float rating)
        {
            if (m_timing != eCombatEventTiming.HIT_QUEUE)
            {
                return(null);
            }

            if (m_times >= m_total_times)
            {
                return(null);
            }

            m_times++;

            ReactionEffectEvent reaction = new ReactionEffectEvent();

            reaction.m_type   = m_type;
            reaction.m_timing = eCombatEventTiming.ON_HIT;

            reaction.m_effect_type = m_effect_type;
            reaction.m_sender      = m_sender;
            reaction.m_target      = m_target;
            reaction.m_parent      = -1;

            reaction.m_children = new List <CombatEvent>();

            reaction.m_total_times  = m_total_times;
            reaction.m_times        = m_times;
            reaction.m_total_damage = m_total_damage;
            // ignore m_damage
            reaction.m_total_show = m_total_show;
            // ignore m_show
            reaction.m_shield = m_shield;

            reaction.m_critical = m_critical;
            reaction.m_miss     = m_miss;

            reaction.m_reaction_type          = m_reaction_type;
            reaction.m_immune_reaction_effect = m_immune_reaction_effect;

            reaction.m_will_be_combo = m_will_be_combo;
            reaction.m_play_state    = m_play_state;

            if (reaction.IsFirst())
            {
                reaction.m_absorb = m_absorb;
            }

            // calculate damage
            if (reaction.IsLast())
            {
                reaction.Damage = Damage;
                reaction.Show   = Show;
            }
            else
            {
                reaction.Damage = Mathf.CeilToInt(TotalDamage * rating);
                reaction.Show   = Mathf.CeilToInt(TotalShow * rating);
            }
            Damage -= reaction.Damage;
            Show   -= reaction.Show;

            return(reaction);
        }
Beispiel #8
0
        public override void TransitionToDown(ReactionEffectEvent reaction_event)
        {
            IsEnd = true;

            SwitchState(Combatant.GetActionState <LieHitActionState>());
        }
Beispiel #9
0
        public override void TransitionToBack(ReactionEffectEvent reaction_event)
        {
            IsEnd = true;

            SwitchState(Combatant.GetActionState <BackStartActionState>());
        }
Beispiel #10
0
 public override void CleanUp()
 {
     Combatant.StopAllCoroutines();
     ReactionEvent = null;
     base.CleanUp();
 }
Beispiel #11
0
 public ReactionEventState(Combatant combatant, ReactionEffectEvent reaction)
     : base(combatant, reaction)
 {
     ReactionEvent = reaction;
 }
Beispiel #12
0
        public override void TransitionToHit(ReactionEffectEvent reaction_event)
        {
            IsEnd = true;

            SwitchState(Combatant.GetActionState <FlowHitActionState>().SetHeight(FlowHeight) as FlowHitActionState);
        }
Beispiel #13
0
 public virtual void TransitionToDown(ReactionEffectEvent reaction_event)
 {
     // force switch
     SwitchState(Combatant.GetActionState <FallDownActionState>());
 }
Beispiel #14
0
 public virtual void TransitionToBack(ReactionEffectEvent reaction_event)
 {
     // force switch
     SwitchState(Combatant.GetActionState <BackStartActionState>());
 }