示例#1
0
 public override void ReceiveHeal(float netHeal, StatsEffected statsHealed)
 {
     myStats.health_C += netHeal;
     if (myStats.health_C > myStats.health_M)
     {
         myStats.health_C = myStats.health_M;
     }
     EventBroadcaster.Instance.PostEvent(EventNames.UPDATE_UNIT_HEALTH);
 }
示例#2
0
 // Update is called once per frame
 private void Update()
 {
     m_effectStats = this;
     if (!Application.isPlaying && m_effectingStats == null && m_statsEffected == null)
     {
         m_effectingStats    = new List <string>();
         m_statsEffected     = new List <string>();
         m_statChanges       = new StatChange();
         m_statChanges       = StatChange.Additive;
         indexValueEffecting = 0;
         indexValueEffected  = 0;
     }
 }
示例#3
0
 public override void ReceiveDamage(float netDamage, StatsEffected statsDamaged)
 {
     // Here we compute the resistance of the certain elements
     myStats.health_C -= netDamage;
     if (myStats.health_C < 0)
     {
         myStats.health_C = 0;
     }
     EventBroadcaster.Instance.PostEvent(EventNames.UPDATE_UNIT_HEALTH);
     if (visualTextHolder != null)
     {
         visualTextHolder.ShowDamage(netDamage);
     }
     myStats.GainsFromDamage(netDamage);
 }
 private void CalculateStat(SecStatistic secondEffecting, SecStatistic secondEffected, StatsEffected m_stats)
 {
     secondEffected.stats = m_stats.operate(secondEffecting.stats, secondEffected.stats);
 }
 //Overloaded functions for primary and secondary change in stats.
 private void CalculateStat(PrimStatisic primary, SecStatistic second, StatsEffected m_stats)
 {
     //Uses the operators in the statseffected to return the funcs.
     second.stats = m_stats.operate(primary.stats, second.stats);
 }
示例#6
0
 private void OnValidate()
 {
     m_effectStats = this;
 }
示例#7
0
 public virtual void ReceiveHeal(float netHeal, StatsEffected statsHealed)
 {
 }
示例#8
0
 public virtual void ReceiveDamage(float netDamage, StatsEffected statsDamaged)
 {
 }