Exemplo n.º 1
0
 public EnableDisableUnitCommand(YTY.AocDatLib.Effect effect)
 {
     UnitId = effect.Arg1;
     if (effect.Arg2 == 1)
     {
         Enable = true;
     }
     else
     {
         Enable = false;
     }
 }
Exemplo n.º 2
0
        public static EffectCommand Get(YTY.AocDatLib.Effect effect)
        {
            switch (effect.Command)
            {
            case 0:
            case 4:
            case 5: return(new AttributeModifierCommand(effect));

            case 2: return(new EnableDisableUnitCommand(effect));

            case 3: return(new UpgradeUnitCommand(effect));

            case 102: return(new DisableTechCommand(effect));
            }

            return(null);
        }
Exemplo n.º 3
0
        public AttributeModifierCommand(YTY.AocDatLib.Effect effect)
        {
            UnitId    = effect.Arg1;
            Class     = (UnitClass)effect.Arg2;
            Attribute = (Attribute)effect.Arg3;
            Amount    = effect.Arg4;

            switch (effect.Command)
            {
            case 0: Mode = ModifierMode.Set; break;

            case 4: Mode = ModifierMode.Add; break;

            case 5: Mode = ModifierMode.Multiply; break;
            }

            ArmorId = 0;
            if (Attribute == Attribute.Armor || Attribute == Attribute.Attack)
            {
                var a = (int)Amount;
                ArmorId = a / 256;
                Amount  = a % 256;
            }
        }
Exemplo n.º 4
0
 public UpgradeUnitCommand(YTY.AocDatLib.Effect effect)
 {
     FromUnitId = effect.Arg1;
     ToUnitId   = effect.Arg2;
 }
Exemplo n.º 5
0
 public DisableTechCommand(YTY.AocDatLib.Effect effect)
 {
     TechId = (int)effect.Arg4;
 }