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)]); } }
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; }
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; }
public HitCrouchState(BasicPlayer player, CMS.Ability ability) : base(player, ability) { }
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; }
public InAirHitState(BasicPlayer player, CMS.Ability ability) : base(player, ability) { }
public HitState(BasicPlayer player, CMS.Ability ability) : base(player) { this.ability = ability; }