コード例 #1
0
 private void PerformBuffOnEntity(Entities.Entity entity)
 {
     Entities.Unit unit = (Unit)entity;
     if (mModules != null)
     {
         unit.AddModulesFromData(mModules);
     }
     if (mStatusTags != null)
     {
         foreach (StatusOperationPair pair in mStatusTags)
         {
             if (pair.mShouldAdd)
             {
                 if (!unit.HasStatus(pair.mTag))
                 {
                     unit.AddStatus(pair.mTag);
                 }
             }
             else
             {
                 unit.RemoveStatus(pair.mTag);
             }
         }
     }
     unit.TemporaryHP += mTempHPBuff;
 }
コード例 #2
0
 public void Run()
 {
     if (mConditions.Check(mParent))
     {
         mParent.AttackModifier     += mAttackBuff;
         mParent.AttackCostModifier += mAttackCostBuff;
         if (mStatus != null && !mParent.HasStatus(mStatus))
         {
             mParent.AddStatus(mStatus);
         }
     }
 }
コード例 #3
0
        protected override bool CheckValidityInternal(Entities.Entity Performer, List <Entities.Entity> Selection, TurnInfo TI)
        {
            Entities.Unit attacker = (Entities.Unit)Performer;
            Entities.Unit target   = (Entities.Unit)Selection[0];

            if (Performer.IsUnit() && Selection[0].IsUnit() && Performer.GetOwnerIndex() != Selection[0].GetOwnerIndex() &&
                TI.GetCPI() == Performer.GetOwnerIndex() && !attacker.HasStatus("Can't attack"))
            {
                return(attacker.CanAttack(target) != -1);
            }
            else
            {
                return(false);
            }
        }