コード例 #1
0
ファイル: Fighter.cs プロジェクト: jmdjr/ls-story-books
        public Fighter(FighterInfo info)
        {
            this.Info = info;

            // Generate Abilities from Ability factory using figher info
            Abilities = new List<Ability>();

            foreach(int abilityId in this.Info.Abilities)
            {
                this.Abilities.Add(AbilityFactory.Factory.Abilities[abilityId]);
            }
        }
コード例 #2
0
ファイル: FighterInfo.cs プロジェクト: jmdjr/ls-story-books
 public FighterInfo Clone()
 {
     FighterInfo clone = new FighterInfo();
     clone.Abilities = this.Abilities;
     clone.Attack = this.Attack;
     clone.Defence = this.Defence;
     clone.Experience = this.Experience;
     clone.Health = this.Health;
     clone.Position = this.Position;
     clone.Speed = this.Speed;
     clone.Name = this.Name;
     clone.mappedSkin = this.mappedSkin;
     return clone;
 }
コード例 #3
0
ファイル: Ability.cs プロジェクト: jmdjr/ls-story-books
 public Ability Clone(FighterInfo info)
 {
     return new Ability(this.Effect);
 }
コード例 #4
0
ファイル: FighterScript.cs プロジェクト: jmdjr/ls-story-books
    void Start()
    {
        if(reference != null)
        {
            FighterInfo = reference.Info;
            BaseStats = reference.fighter.Info;
            name = FighterInfo.Name;

            reference.OnActivateAbility += OnActivateAbility;
            reference.OnCompleteAbility += OnCompleteAbility;
            reference.OnDeath += OnDeath;
            reference.OnDamage += OnDamage;
            reference.OnDefend += OnDefend;

            Vector3 temp = transform.localPosition;
            stepBack = new Vector3(temp.x, temp.y, temp.z);
            stepForward = new Vector3(stepBack.x + 1, stepBack.y, stepBack.z);
            stepDead = new Vector3(temp.x - 2, temp.y, temp.z);
            stepBlock = new Vector3(temp.x -1, temp.y, temp.z);

            animator = GetComponent<Animator>();
            GameControlScript control = GameControlScript.control;
            this.animator.runtimeAnimatorController = control.ACreferences.FromName(reference.Info.mappedSkin);
        }
    }