override protected void Start() { manager = Object.FindObjectOfType <TurnManager>(); panel = Object.FindObjectOfType <GUIPanel>(); PopupTextController.Initialize(); creatureMechanics = GetComponent <CreatureMechanics>(); selectedAction = GetComponent <ActionBasicAttack>(); //gameSignal = (GameSignalOneObject)Resources.Load("Game Signals/SetConcentration", typeof(GameSignalOneObject)); base.Start(); }
// ... more data related to the character displayed information. public void UpdateData(CreatureMechanics creature) { textName.text = creature.displayName; textSpeed.text = kSpeed + creature.Speed; // ... Update other stuff var isAi = creature.GetComponent <EnemyController>() != null; textName.color = isAi ? Color.red : Color.blue; }
public void DisplayStats(CreatureMechanics unit) { dodgeValueText.text = unit.DodgeChance() + " %"; backstabValueText.text = unit.BonusRearDamageMin() + "-" + unit.BonusRearDamageMax(); damageValueText.text = unit.MinDamage() + "-" + unit.MaxDamage(); accValueText.text = unit.HitChance() + " %"; critValueText.text = unit.CritChance() + " %"; lifeValueText.text = unit.LifeString(); staminaValueText.text = unit.StaminaString(); nameValueText.text = unit.displayName; }
// Some status effects have varying power levels, others default to -1 public StatusEffect(EffectType effectType, int durationRounds, ObjectMechanics effectTarget, int effectPowerLevel = -1) { // Only CreatureMechanics can get status effects. if (effectTarget.GetType() == typeof(ObjectMechanics)) { return; } roundsRemaining = durationRounds; type = effectType; target = (CreatureMechanics)effectTarget; powerLevel = effectPowerLevel; target.RegisterStatusEffect(this); }
// Start is called before the first frame update virtual protected void Start() { combatController = GetComponent <CombatController>(); anim = GetComponentInChildren <Animator>(); mechanics = GetComponent <CreatureMechanics>(); }