예제 #1
0
 public void moraleRally()
 {
     if (this.morale != Morale.Foolish)
     {
         this.morale = (Morale)((int)this.morale * 2);
     }
 }
예제 #2
0
 public void moraleBreak()
 {
     if (this.morale != Morale.Terrified)
     {
         this.morale = (Morale)((int)this.morale / 2);
     }
 }
예제 #3
0
파일: Main.cs 프로젝트: neil501/UAASMods
 private static void Postfix(Morale __instance, ref UnitModel ___data)
 {
     if (_settings.MaxMorale && ___data.side == RuntimeVars.playerSide)
     {
         __instance.morale = 1f;
         ___data.morale    = 1f;
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     attackerMorale       = 5;
     defenderMorale       = 5;
     attackerBarGUI.value = attackerMorale;
     defenderBarGUI.value = defenderMorale;
     M = this;
 }
 private void CloneProperties(object aClone)
 {
     Articy.ManiacManfred.Templates.Player_CharacterTemplate newClone = ((Articy.ManiacManfred.Templates.Player_CharacterTemplate)(aClone));
     if ((Morale != null))
     {
         newClone.Morale = ((Articy.ManiacManfred.Features.MoraleFeature)(Morale.CloneObject()));
     }
     if ((Character != null))
     {
         newClone.Character = ((Articy.ManiacManfred.Features.CharacterFeature)(Character.CloneObject()));
     }
 }
        public void setProp(string aProperty, object aValue)
        {
            int featureIndex = aProperty.IndexOf('.');

            if ((featureIndex != -1))
            {
                string featurePath     = aProperty.Substring(0, featureIndex);
                string featureProperty = aProperty.Substring((featureIndex + 1));
                if ((featurePath == "Morale"))
                {
                    Morale.setProp(featureProperty, aValue);
                }
                if ((featurePath == "Character"))
                {
                    Character.setProp(featureProperty, aValue);
                }
            }
        }
        public Articy.Unity.Interfaces.ScriptDataProxy getProp(string aProperty)
        {
            int featureIndex = aProperty.IndexOf('.');

            if ((featureIndex != -1))
            {
                string featurePath     = aProperty.Substring(0, featureIndex);
                string featureProperty = aProperty.Substring((featureIndex + 1));
                if ((featurePath == "Morale"))
                {
                    return(Morale.getProp(featureProperty));
                }
                if ((featurePath == "Character"))
                {
                    return(Character.getProp(featureProperty));
                }
            }
            return(null);
        }
예제 #8
0
 protected override void TalentAction()
 {
     // Если этот талант уже был использован на прошлый ход, то выполнить его еще раз нельзя
     if (!_alreadyUsed)
     {
         if (Random.Range(1, 101) <= _moraleChance)
         {
             _alreadyUsedBy = this;
             _alreadyUsed   = true;
             _controller.SwitchTurn(_team);
             _onActionSound.Play();
         }
     }
     else
     {
         // Эта проверка нужна, чтобы изменить переменную _alreadyUsed на false мог только тот талант, который назначил ей true
         if (ReferenceEquals(_alreadyUsedBy, this))
         {
             _alreadyUsed = false;
         }
     }
 }