Esempio n. 1
0
    private static void fetchCMVAbilities(CMS cms, int abilitiesStart)
    {
        // Debug.Log(abilitiesStart);
        string[] lines            = cms.File.text.Split("\n"[0]);
        string[] ignoredAbilities = { "input", "hit level" };
        string[] row            = SplitCsvLine(lines[abilitiesStart]);
        string[] abilitiesInfos = new string[row.Length - 1];
        // Debug.Log("Récupération des variables de combat ----------------------------");
        for (int i = 1; i < row.Length - 1; ++i)
        {
            abilitiesInfos[i] = row[i].ToLower();
            // Debug.Log(abilitiesInfos[i]);
        }
        for (int i = ++abilitiesStart; i < lines.Length; ++i)
        {
            row = SplitCsvLine(lines[i].ToLower());
            // Debug.Log(row[0]);
            CMS.Ability ability = new CMS.Ability(row[0]);
            for (int j = 1; j < row.Length - 1; ++j)
            {
                if (!ignoredAbilities.Contains(abilitiesInfos[j]))
                {
                    ability.informations.Add(abilitiesInfos[j], double.Parse(row[j]));
                }
            }
            cms.abilities.Add(row[0], ability);
            // Debug.Log(ability.informations.ToString());
        }

        for (int i = 0; i < cms.abilities.Count; ++i)
        {
            // Debug.Log(cms.abilities.Keys.ElementAt(i));
            // Debug.Log(cms.abilities[cms.abilities.Keys.ElementAt(i)]);
        }
    }
Esempio n. 2
0
    public override void Attack(string action)
    {
        string animation = availableActions[action];

        if (animation == null)
        {
            return;
        }
        CMS.Ability abilityInformations = GetAbilityInformations(action);
        abilityInformations.name = animation;
        player.ChangeState(new InAirHitState(player, abilityInformations));
        return;
    }
Esempio n. 3
0
    public virtual void Attack(string action)
    {
        string animation;

        try{
            animation = availableActions[action];
        }
        catch (NullReferenceException e) {
            return;
        }
        CMS.Ability abilityInformations = GetAbilityInformations(action);
        abilityInformations.name = animation;
        player.ChangeState(new HitState(player, abilityInformations));
        return;
    }
Esempio n. 4
0
 public HitCrouchState(BasicPlayer player, CMS.Ability ability) : base(player, ability)
 {
 }
Esempio n. 5
0
 public void ChangeHitInformations(CMS.Ability ability)
 {
     this.damages = Mathf.RoundToInt((float)ability.informations["damage"]);
     this.hitStun = Mathf.RoundToInt((float)ability.informations["hit stun"]);
     this.action  = ability.name;
 }
Esempio n. 6
0
 public InAirHitState(BasicPlayer player, CMS.Ability ability) : base(player, ability)
 {
 }
Esempio n. 7
0
 public HitState(BasicPlayer player, CMS.Ability ability) : base(player)
 {
     this.ability = ability;
 }