コード例 #1
0
        public static void GameActionFightDispellableEffectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameActionFightDispellableEffectMessage msg = (GameActionFightDispellableEffectMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.FightData.SetEffect(msg.effect, msg.actionId);
        }
コード例 #2
0
        public static void GameActionFightDispellableEffectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            GameActionFightDispellableEffectMessage msg = (GameActionFightDispellableEffectMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.Fight != null)
            {
                if (msg.effect is FightTemporaryBoostStateEffect)
                {
                    FightTemporaryBoostStateEffect effect = (FightTemporaryBoostStateEffect)msg.effect;
                    if (effect.targetId == account.Fight.Fighter.Id)
                    {
                        if (account.Fight.DurationByEffect.ContainsKey(effect.stateId))
                        {
                            account.Fight.DurationByEffect.Remove(effect.stateId);
                        }
                        account.Fight.DurationByEffect.Add(effect.stateId, effect.turnDuration);
                    }
                }
                else if (msg.effect is FightTemporaryBoostEffect)
                {
                    FightTemporaryBoostEffect effect = (FightTemporaryBoostEffect)msg.effect;
                    if (msg.actionId == 168)
                    {
                        ((BFighter)account.Fight.Fighter).ActionPoints = account.Fight.Fighter.ActionPoints - effect.delta;
                    }
                    else if (msg.actionId == 169)
                    {
                        ((BFighter)account.Fight.Fighter).MovementPoints = account.Fight.Fighter.MovementPoints - effect.delta;
                    }
                }
            }
        }