virtual public void Effect(GameObject user, AEntityAttribute <TModuleType> playerAttri) { //if user.tag == player on get le player attribute sinon on get l'enemi attribute playerAttri.ManaCurrent -= manaCost; playerAttri.SkillTimer = 0; }
virtual public bool CanUseSkill(AEntityAttribute <TModuleType> playerAttri) { if (playerAttri.ManaCurrent < manaCost) { ServiceLocator.Instance.ErrorDisplayStack.Add("You don't have enough mana", e_errorDisplay.Warning); } if (type == e_skillType.Simple) { if (playerAttri.SkillTimerMultPercent < countdown) { ServiceLocator.Instance.ErrorDisplayStack.Add("You can't use this skill now, you have to wait", e_errorDisplay.Warning); } return(playerAttri.ManaCurrent >= manaCost && playerAttri.SkillTimerMultPercent >= countdown); } else if (type == e_skillType.Anti_Cast) { if (playerAttri.SkillTimer < countdown) { ServiceLocator.Instance.ErrorDisplayStack.Add("You can't use this skill now, you have to wait", e_errorDisplay.Warning); } return(playerAttri.ManaCurrent >= manaCost && playerAttri.SkillTimer >= countdown); } return(false); }
public override void LevelUp(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.LevelUp(user, playerAttri); if (learned) { care.min = GetMinCare(level.Current, playerAttri); care.min = GetMaxCare(level.Current, playerAttri); } }
public void InitializeGenerator(AEntityAttribute <TModuleType> entityAttribute) { float itemQuantityPercent = entityAttribute.attributes[(int)e_entityAttribute.Item_Quantity_Percent] * 0.01f; float itemRarityPercent = entityAttribute.attributes[(int)e_entityAttribute.Item_Rarity_Percent] * 0.01f; float goldAmountPercent = entityAttribute.attributes[(int)e_entityAttribute.Gold_Amount_Percent] * 0.01f; float goldQuantityPercent = entityAttribute.attributes[(int)e_entityAttribute.Gold_Quantity_Percent] * 0.01f; float goldRarityPercent = entityAttribute.attributes[(int)e_entityAttribute.Gold_Rarity_Percent] * 0.01f; this.lootAttribute.Initialize(itemQuantityPercent, itemRarityPercent, goldAmountPercent, goldQuantityPercent, goldRarityPercent); }
virtual public void LevelUp(GameObject user, AEntityAttribute <TModuleType> playerAttri) { //if user.tag == player on get le player attribute sinon on get l'enemi attribute if (CanLevelUp(playerAttri)) { ++level.Current; --playerAttri.SkillRemain; learned = true; } }
public string GetDescription(string whichLevel, int lvl, AEntityAttribute <TModuleType> playerAttri) { string result = base.GetDescription(whichLevel, lvl); foreach (var attri in fixedAttributes) { result += "<b><color=red>" + attri.WhichAttribute.ToString().Replace("_", "") + "</color></b> : " + GetAttribute(lvl, playerAttri, attri.WhichAttribute).ToString("F2"); } return(result); }
public override void Effect(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Effect(user, playerAttri); GameObject simpleCareObject = ServiceLocator.Instance.ObjectManager.Instantiate("SimpleHeal"); SimpleHeal <TModuleType> simpleHeal = simpleCareObject.GetComponent <SimpleHeal <TModuleType> >(); simpleHeal.Care = new MinMaxf(care.min, care.max); simpleHeal.UserAttribute = playerAttri; }
public float GetFastCastFloat(AEntityAttribute <TModuleType> playerAttri) { if (type == e_skillType.Simple) { return(countdown / playerAttri.CastSpeedPercent); } else if (type == e_skillType.Anti_Cast) { return(countdown); } return(0); }
public override void Effect(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Effect(user, playerAttri); warScream = ServiceLocator.Instance.ObjectManager.Instantiate("WarScream", user.transform.position, user.transform.rotation); WarScream <TModuleType> warScreamScript = warScream.GetComponent <WarScream <TModuleType> >(); warScreamScript.targetTag = targetTag; warScreamScript.damage = damage.RandomBetweenValues(); warScreamScript.fastCast = 25.0f; warScreamScript.user = playerAttri; }
void Awake() { this.player = base.ModuleManager.Attributes as AEntityAttribute <TModuleType>; this.itemMgr = base.ModuleManager.Items as ItemManager <TModuleType>; this.objectAttributeToString = new ObjectAttributeToString <TModuleType>() as ObjectAttributeToString <TModuleType>; this.GUIWindowInitialization(new Rect(0, 0, 1, 1)); this.scrollPosition = Vector2.zero; this.filtre = ItemExtension.FiltreAll; this.meshToDisplay = null; }
public override void Effect(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Effect(user, playerAttri); fireball = ServiceLocator.Instance.ObjectManager.Instantiate("Fireball", user.transform.position, user.transform.rotation); Fireball <TModuleType> fireballScript = fireball.GetComponent <Fireball <TModuleType> >(); fireballScript.targetTag = targetTag; fireballScript.damage = damage.RandomBetweenValues(); fireballScript.moveSpeed = 25.0f; fireballScript.user = playerAttri; }
public void Update(GameObject gameObject, AEntityAttribute <TModuleType> entityAttribute) { foreach (KeyValuePair <e_skillCategory, SortedDictionary <string, Skill <TModuleType> > > skillsTmp in this.skills) { foreach (KeyValuePair <string, Skill <TModuleType> > skill in skillsTmp.Value) { if (skill.Value.learned) { skill.Value.Update(gameObject, entityAttribute); } } } }
public override void Update(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Update(user, playerAttri); if (user.tag == "PlayerInfo") { targetTag = "Enemy"; } else { targetTag = "Player"; } }
public override void LevelUp(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.LevelUp(user, playerAttri); if (learned) { if (level.Current % 5 == 0) { ++grade; } manaCost = GetManaCost(level.Current); } }
public override void LevelUp(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.LevelUp(user, playerAttri); if (learned) { if (level.Current % 5 == 0) { manaCost -= 5; } } damage.Initialize((int)(80 + 40 * level.Current * playerAttri.SkillEffectPercent), (int)(120 + 60 * level.Current * playerAttri.SkillEffectPercent)); }
public void PlayASkill(GameObject user, AEntityAttribute <TModuleType> entityAttribute, string skillName) { Skill <TModuleType> skill = this.Get(skillName); if (null != skill) { if (skill.learned) { if (skill.CanUseSkill(entityAttribute)) { skill.Effect(user, entityAttribute); } } } }
public override void Initialize(GameObject user, AEntityAttribute <TModuleType> attributes) { FireballSkill <TModuleType> skillFireBall = new FireballSkill <TModuleType>(); SimpleHealSkill <TModuleType> skillHeal = new SimpleHealSkill <TModuleType>(); WarScreamSkill <TModuleType> skillScream = new WarScreamSkill <TModuleType>(); // AREGLE PLUSTARD //skillFireBall.LevelUp(user, attributes); //skillHeal.LevelUp(user, attributes); //skillScream.LevelUp(user, attributes); ; //this.Add(skillFireBall); //this.Add(skillHeal); //this.Add(skillScream); //this.Add(new FearScreamSkill<TModuleType>()); }
public override void SetDescription(AEntityAttribute <TModuleType> playerAttri) { description.LevelInformation = GetDescription("Current Level", level.Current, playerAttri) + GetManaCostCountdown(manaCost, playerAttri) + GetSKS(playerAttri) + "\n\n</size>" + ((level.Current < level.Max) ? GetDescription("Next Level", level.Current + 1, playerAttri) + GetManaCostCountdown(GetManaCost(level.Current + 1), playerAttri) + GetSKS(playerAttri) + "\n\n</size>" : "") + GetDescription("Last Level", level.Max, playerAttri) + GetManaCostCountdown(GetManaCost(level.Max), playerAttri) + GetSKS(playerAttri) + "</size>"; }
public override void Update(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Update(user, playerAttri); damage.Initialize((int)(30 * level.Current * 0.5f + playerAttri.Mana.Max * 0.1f * playerAttri.SkillEffectPercent), (int)(45 * level.Current * 0.5f + playerAttri.Mana.Max * 0.12f * playerAttri.SkillEffectPercent)); if (user.tag == "PlayerInfo") { targetTag = "Enemy"; } else { targetTag = "Player"; } }
public override void Effect(GameObject user, AEntityAttribute <TModuleType> playerAttri) { base.Effect(user, playerAttri); GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy"); foreach (var enemy in enemies) { if (Vector3.Distance(user.transform.position, enemy.transform.position) <= 15.0f) { //EnemyIA AI = enemy.GetComponent<EnemyIA>(); //if (AI) // AI.IsFeared = true; } } }
public void Action(GameObject user, AEntityAttribute <TModuleType> playerAttribute, ASkillManager <TModuleType> mgr) { if (this.equipped != e_equipmentEquipped.NOT_EQUIPPED && this.skill.CanUseSkill(playerAttribute)) { if (skill.category == e_skillCategory.Destruction) { mgr.PlayASkill(user, playerAttribute, "Fireball"); } if (skill.category == e_skillCategory.Heal) { mgr.PlayASkill(user, playerAttribute, "Simple Heal"); } if (skill.category == e_skillCategory.Power) { mgr.PlayASkill(user, playerAttribute, "earScream"); } } //skill.Effect(user, playerAttribute); }
public List <ObjectAttributeCompared> GetTheWhiteAttributesCompared(AStuff <TModuleType> equippedStuff, AEntityAttribute <APlayer> player) { List <ObjectAttributeCompared> objectAttri = new List <ObjectAttributeCompared>(); int whiteAttributeIndex = 0; if (this is AWeapon <TModuleType> ) { float damageX = this.whiteAttributes[0].Value - equippedStuff.whiteAttributes[0].Value; float damageY = this.whiteAttributes[1].Value - equippedStuff.whiteAttributes[1].Value; objectAttri.Add(new ObjectAttributeCompared("Damage Minimal", damageX, this.whiteAttributes[0].Value)); objectAttri.Add(new ObjectAttributeCompared("Damage Maximal", damageY, this.whiteAttributes[1].Value)); whiteAttributeIndex = 2; } else { var cast = this as ACast <TModuleType>; if (cast != null) { var equippedCast = this as ACast <TModuleType>; float manaCost = cast.ManaCost - equippedCast.ManaCost; objectAttri.Add(new ObjectAttributeCompared("Mana Cost", manaCost, cast.ManaCost)); } } for (; whiteAttributeIndex < this.whiteAttributes.Count; whiteAttributeIndex++) { float difference = this.GetAttributeValue(this.whiteAttributes[whiteAttributeIndex]) - equippedStuff.GetAttributeValue(equippedStuff.whiteAttributes[whiteAttributeIndex]); objectAttri.Add(new ObjectAttributeCompared(this.whiteAttributes[whiteAttributeIndex].WhichAttribute.ToString(), difference, this.GetAttributeValue(this.whiteAttributes[whiteAttributeIndex]))); } objectAttri.Add(new ObjectAttributeCompared("Level Requiered", player.Level - this.levelRequiered, this.levelRequiered)); return(objectAttri); }
} //AR REGLE PLUS TARDthis.Update(Player.gameObject, base.ModuleManager.Attributes); } public abstract void Initialize(GameObject user, AEntityAttribute <TModuleType> attributes);
public abstract int GetMaxDamage(int lvl, AEntityAttribute <TModuleType> playerAttri);
public string GetDPSString(int lvl, AEntityAttribute <TModuleType> playerAttri) { return(GetDPSFloat(lvl, playerAttri).ToString("F2")); }
public float GetDPSFloat(int lvl, AEntityAttribute <TModuleType> playerAttri) { return((GetMinDamage(lvl, playerAttri) + GetMinDamage(lvl, playerAttri)) * 0.5f * GetSKSFloat(playerAttri)); }
public string GetDPSSPS(int lvl, AEntityAttribute <TModuleType> playerAttri) { return("\n<b><color=red>DPS</color></b> : " + GetDPSString(lvl, playerAttri) + "\n<b><color=red>SPS</color></b> : " + GetSKSString(playerAttri) + "</size>"); }
public string GetDescription(string whichLevel, int lvl, AEntityAttribute <TModuleType> playerAttri) { return(base.GetDescription(whichLevel, lvl) + "<b><color=red>Damage type</color></b> : " + this.elementaryDamage.ToString() + "\n<b><color=red>Damage</color></b> : (" + GetMinDamage(lvl, playerAttri).ToString("F0") + "-" + GetMaxDamage(lvl, playerAttri).ToString("F0") + ")"); }
public string GetDescription(string whichLevel, int lvl, AEntityAttribute <TModuleType> playerAttri) { return(base.GetDescription(whichLevel, lvl) + "<b><color=red>Care</color></b> : (" + GetMinCare(lvl, playerAttri).ToString("F0") + "-" + GetMaxCare(lvl, playerAttri).ToString("F0") + ")"); }
public abstract int GetMaxInvocationNumber(int lvl, AEntityAttribute <TModuleType> playerAttri);