protected A_Ability(GameEnum.AbilityName abilityName, int manaCost, float cooldown, float maxRange, AudioClip clip, A_Airship owner) { this.abilityName = abilityName; this.manaCost = manaCost; this.cooldown = cooldown; this.maxRange = maxRange; this.clip = clip; this.owner = owner; }
public A_Ability CloneAbility(GameEnum.AbilityName abilityName, A_Airship owner) { /* * if (this.abilitiesDict.ContainsKey (abilityName)) * return this.abilitiesDict [abilityName].Clone (owner); * return null; */ return(this.abilityFactory.CloneAbility(abilityName, owner)); }
private PartyCharacter CreateNewPartyCharacter(int inventoryNum) { PartyCharacter c = new PartyCharacter(inventoryNum); // Create the ability and assign to the character. GameEnum.AbilityName abilityName = GameManager.instance.Data.GetInventoryCharacterAbilityName(inventoryNum); c.SetAbility(GameManager.instance.Data.CloneAbility(abilityName, airship)); return(c); }
public void SetPartyCharacter(PartyCharacter character) { this.character = character; // Update the displays foreach (DisplayProperties dp in this.displayProperties) { dp.iconImage.sprite = character.Icon; dp.nameText.text = character.Name; dp.hpImage.fillAmount = m_maxFill; dp.mpImage.fillAmount = m_maxFill; dp.roleName.text = string.Format("Lv. {0} {1}", GameHelper.ConvertExpToLevel(character.Exp).ToString(), character.Role.ToString()); if (this.displayType == GameEnum.DisplayType.CIRCLE) { dp.cdImage.fillAmount = 0.0f; } else { dp.cdImage.fillAmount = m_maxFill; } dp.hpText.text = string.Format("{0} / {1}", character.CurHp.ToString(), character.MaxHp.ToString()); dp.mpText.text = string.Format("{0} / {1}", character.CurMp.ToString(), character.MaxMp.ToString()); } // Set tooltip info. if (character.Ability != null) { GameEnum.AbilityName abilityName = character.Ability.AbilityName; this.tooltipProperties.tooltipAbilityName.text = GameManager.instance.Data.GetAbilityStringName(abilityName); this.tooltipProperties.tooltipAbilityDesc.text = GameManager.instance.Data.GetAbilityDesc(abilityName); this.tooltipProperties.tooltipAbilityMana.text = GameManager.instance.Data.GetAbilityStringManaCost(abilityName).ToString(); this.tooltipProperties.tooltipAbilityCooldown.text = GameManager.instance.Data.GetAbilityStringCooldown(abilityName).ToString(); this.tooltipProperties.tooltipParent.SetActive(false); if (this.character.CurMp < this.character.MaxMp) { this.RechargeMana(); } } else { this.tooltipProperties.tooltipAbilityName.text = ""; this.tooltipProperties.tooltipAbilityDesc.text = ""; this.tooltipProperties.tooltipAbilityMana.text = ""; this.tooltipProperties.tooltipAbilityCooldown.text = ""; this.tooltipProperties.tooltipParent.SetActive(false); } }
/* * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_STRAIGHTBULLET, new Ability_StraightShot(this.abilityScriptables.straightShot.projectilePrefab, null)); * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_TARGETAOE, new Ability_TargetAOE(this.abilityScriptables.targetAOE.projectilePrefab, null)); * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_AUTOBULLET, new Ability_AutoBullet(this.abilityScriptables.autoBullet.projectilePrefab, null)); * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_FRONTSWIPE, new Ability_FrontSwipe(this.abilityScriptables.frontSwipe.swipePrefab, null)); * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_HOMINGMISSILE, new Ability_HomingMissile(this.abilityScriptables.homingMissile.projectilePrefab, null)); * this.abilitiesDict.Add(GameEnum.AbilityName.ABILITY_BLINKFORWARD, new Ability_BlinkForward(null)); */ public A_Ability CloneAbility(GameEnum.AbilityName abilityName, A_Airship owner) { int abilityInt = (int)abilityName; if (abilityInt < this.abilityScriptables.abilities.Length) { SO_Abilities.AbilityProperties ability = this.abilityScriptables.abilities [abilityInt]; switch (abilityName) { case GameEnum.AbilityName.NONE: break; case GameEnum.AbilityName.ABILITY_STRAIGHTBULLET: return(new Ability_StraightShot(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; case GameEnum.AbilityName.ABILITY_TARGETAOE: return(new Ability_TargetAOE(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; case GameEnum.AbilityName.ABILITY_AUTOBULLET: return(new Ability_AutoBullet(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; case GameEnum.AbilityName.ABILITY_FRONTSWIPE: return(new Ability_FrontSwipe(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; case GameEnum.AbilityName.ABILITY_HOMINGMISSILE: return(new Ability_HomingMissile(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; case GameEnum.AbilityName.ABILITY_BLINKFORWARD: return(new Ability_BlinkForward(ability.abilityName, ability.manaCost, ability.cooldown, ability.maxRange, ability.projectilePrefab, ability.clip, owner)); break; default: break; } } return(null); }
public CharacterSerialized(GameEnum.CharacterName charName, string name, string desc, int baseHp, int baseMp, GameEnum.AbilityName ability, GameEnum.RoleName role) { this.charName = charName; this.name = name; this.desc = desc; this.baseHp = baseHp; this.baseMp = baseMp; this.ability = ability; this.curRole = role; this.curHp = baseHp; this.curMp = baseMp; // Initialize exp for each role to 0; this.roleExp = new int[2]; for (int i = 0; i < 2; i++) { this.roleExp[i] = 0; } }
public Ability_StraightShot(GameEnum.AbilityName abilityname, int manaCost, float cooldown, float maxRange, GameObject projectilePrefab, AudioClip clip, A_Airship owner) : base(abilityname, manaCost, cooldown, maxRange, clip, owner) { this.projectilePrefab = projectilePrefab; }
public float GetAbilityStringMaxRange(GameEnum.AbilityName abilityName) { return(this.abilityScriptables.abilities [(int)abilityName].maxRange); }
public float GetAbilityStringCooldown(GameEnum.AbilityName abilityName) { return(this.abilityScriptables.abilities [(int)abilityName].cooldown); }
public int GetAbilityStringManaCost(GameEnum.AbilityName abilityName) { return(this.abilityScriptables.abilities [(int)abilityName].manaCost); }
public string GetAbilityDesc(GameEnum.AbilityName abilityName) { return(this.abilityScriptables.abilities [(int)abilityName].desc); }
public string GetAbilityStringName(GameEnum.AbilityName abilityName) { return(this.abilityScriptables.abilities [(int)abilityName].name); }