Example #1
0
 public void Step(ref HealthPickupInfo token, Enum condition)
 {
     if ((DamageCondition)condition == DamageCondition.heal)
     {
         OnHealEvent(ref token);
     }
 }
Example #2
0
        //adding method to heal
        void Heal <T> (ref T heal) where T : IHealInfo
        {
            var node            = nodesDB.QueryNode <HealthNode>(heal.entityHealed);
            var healthComponent = node.healthComponent;


            int health = healthComponent.currentHealth + heal.HPGained;

            healthComponent.currentHealth = Math.Min(health, healthComponent.maxHealth);

            //using -1 for pickupID as I can't retrieve the pickupID here and we don't actuallneed the value
            HealthPickupInfo info = new HealthPickupInfo(heal.entityHealed, -1, heal.HPGained);

            _healSequence.Next(this, ref info, DamageCondition.heal);
        }
Example #3
0
 //Healing event
 //similar to damage event but increases value of the slider, and doesn't flash the damage image
 void OnHealEvent(ref HealthPickupInfo token)
 {
     _guiNode.healthSliderComponent.healthSlider.value = nodesDB.QueryNode <HUDDamageEventNode>(token.entity).healthComponent.currentHealth;
 }