Inheritance: ConcreteAttribute
コード例 #1
0
 public CharacterData(AttackAttribute attackAttribute, DefenseAttribute defenseAttribute, SpeedAttribute speedAttribute, HealthAttribute healthAttribute)
 {
     this.attackAttribute  = attackAttribute;
     this.defenseAttribute = defenseAttribute;
     this.speedAttribute   = speedAttribute;
     this.HealthAttribute  = healthAttribute;
 }
コード例 #2
0
 public CharacterData(AttackAttribute attackAttribute, DefenseAttribute defenseAttribute, SpeedAttribute speedAttribute, HealthAttribute healthAttribute)
 {
     this.attackAttribute = attackAttribute;
     this.defenseAttribute = defenseAttribute;
     this.speedAttribute = speedAttribute;
     this.HealthAttribute = healthAttribute;
 }
コード例 #3
0
    public void Perform(ControllableUnit sourceUnit, ControllableUnit targetUnit)
    {
        AttributeBonus damageOutcome = new AttributeBonus(-2, 1);

        HealthAttribute healthAttribute = targetUnit.GetCharacterData().GetHealthAttribute();

        healthAttribute.AddAttributeBonus(damageOutcome);

        Debug.Log("Normal attack skill to " + targetUnit + ". Unit new HP is: " + targetUnit.GetCharacterData().GetHealthAttribute().GetModifiedValue());


        this.PerformAnimation(sourceUnit, targetUnit);
    }
コード例 #4
0
    private void CharacterTestDefault()
    {
        AttackAttribute  attackAttribute  = new AttackAttribute(1, 1.0f);
        DefenseAttribute defenseAttribute = new DefenseAttribute(1, 1.0f);
        HealthAttribute  healthAttribute  = new HealthAttribute(1, 1.0f);
        SpeedAttribute   speedAttribute   = new SpeedAttribute(1, 1.0f);

        this.character = new CharacterData(attackAttribute, defenseAttribute, speedAttribute, healthAttribute);

        Debug.Log("-----Default Stats------");
        Debug.Log("Health: " + this.character.GetHealthAttribute().GetModifiedValue() +
                  " Attack: " + this.character.GetAttackAttribute().GetModifiedValue() +
                  " Defense: " + this.character.GetDefenseAttribute().GetModifiedValue() +
                  " Speed: " + this.character.GetSpeedAttribute().GetModifiedValue());
        Debug.Log("----Default Stats End----");
    }
コード例 #5
0
    private void CharacterTestDefault()
    {
        AttackAttribute attackAttribute = new AttackAttribute(1, 1.0f);
        DefenseAttribute defenseAttribute = new DefenseAttribute(1, 1.0f);
        HealthAttribute healthAttribute = new HealthAttribute(1,1.0f);
        SpeedAttribute speedAttribute = new SpeedAttribute(1,1.0f);

        this.character = new CharacterData(attackAttribute, defenseAttribute, speedAttribute, healthAttribute);

        Debug.Log ("-----Default Stats------");
        Debug.Log ("Health: " +this.character.GetHealthAttribute().GetModifiedValue() +
            " Attack: " +this.character.GetAttackAttribute().GetModifiedValue() +
            " Defense: " +this.character.GetDefenseAttribute().GetModifiedValue() +
            " Speed: " +this.character.GetSpeedAttribute().GetModifiedValue());
        Debug.Log ("----Default Stats End----");
    }