TSpell F412_xxxx_MENUS_GetChampionSpellCastResult(ILiveEntity P795_i_ChampionIndex, IPowerSymbol powerSymbol) { int A1269_ui_RequiredSkillLevel; var L1270_ps_Champion = P795_i_ChampionIndex; IPowerSymbol L1268_i_PowerSymbolOrdinal = powerSymbol; int L1273_ui_Experience = rand.Next(8) + ((A1269_ui_RequiredSkillLevel = SkillLevel + L1268_i_PowerSymbolOrdinal.LevelOrdinal) << 4) + (((L1268_i_PowerSymbolOrdinal.LevelOrdinal - 1) * SkillLevel) << 3) + (A1269_ui_RequiredSkillLevel * A1269_ui_RequiredSkillLevel); var usedSkill = P795_i_ChampionIndex.GetSkill(Skill); int A1267_ui_SkillLevel = usedSkill.SkillLevel; if (A1267_ui_SkillLevel < A1269_ui_RequiredSkillLevel) { int L1274_i_MissingSkillLevelCount = A1269_ui_RequiredSkillLevel - A1267_ui_SkillLevel; while (L1274_i_MissingSkillLevelCount-- > 0) { if (rand.Next(128) > MathHelper.Min(L1270_ps_Champion.GetProperty(PropertyFactory <WisdomProperty> .Instance).Value + 15, 115)) { usedSkill.AddExperience(L1273_ui_Experience >> (A1269_ui_RequiredSkillLevel - A1267_ui_SkillLevel)); F410_xxxx_MENUS_PrintSpellFailureMessage(L1270_ps_Champion, "C00_FAILURE_NEEDS_MORE_PRACTICE", Skill); return(null); } } } TSpell spell = ApplySpellEffect(L1270_ps_Champion, L1268_i_PowerSymbolOrdinal, A1267_ui_SkillLevel); usedSkill.AddExperience(L1273_ui_Experience); //TODO =>F330_szzz_CHAMPION_DisableAction(P795_i_ChampionIndex, Duration); return(spell); }
public MagicTorchSpell(IPowerSymbol powerSymbol, MagicTorchSpellFactory factory) { Factory = factory; int spellPower = (powerSymbol.LevelOrdinal + 1) << 2; duration = 2000 + ((spellPower - 3) << 7); duration *= 1000 / 6; lightPower = (spellPower >> 2) + 1; }
public bool TryBeginCastSpell(IPowerSymbol powerSymbol) { currentSequence = new List <ISpellSymbol>(); //var requiredMana = PowerSymbolFactories.Contains(powerSymbol); if (mana.Value < powerSymbol.ManaCostMultipler) { return(false); } CurrentPowerSymbol = powerSymbol; mana.Value -= powerSymbol.ManaCostMultipler; return(true); }
protected override OpenDoorSpell ApplySpellEffect(ILiveEntity entity, IPowerSymbol powerSymbol, int skillLevel) { skillLevel <<= 1; int kineticEnergy = MathHelper.Clamp(21, (powerSymbol.LevelOrdinal + 2) * (4 + (skillLevel << 1)), 255); var values = F327_kzzz_CHAMPION_IsProjectileSpellCast(entity, kineticEnergy, 0); if (values != null) { var val = values.Value; return(new OpenDoorSpell(val.KineticEnergy, val.StepEnergy)); } else { return(null); } }
public bool TryCastSpell(IEnumerable <ISpellFactory <ISpell> > spellFactories) { if (CurrentPowerSymbol == null || !currentSequence.Any()) { return(false); } var factory = spellFactories.FirstOrDefault(f => f.CastingSequence.SequenceEqual(currentSequence)); var spell = factory?.CastSpell(CurrentPowerSymbol, Entity); spell?.Run(Entity, Entity.MapDirection); currentSequence = new List <ISpellSymbol>(); CurrentPowerSymbol = null; return(factory != null && spell != null); }
public virtual TSpell CastSpell(IPowerSymbol powerSymbol, ILiveEntity caster) { return(F412_xxxx_MENUS_GetChampionSpellCastResult(caster, powerSymbol)); }
protected abstract TSpell ApplySpellEffect(ILiveEntity entity, IPowerSymbol powerSymbol, int skillLevel);
public void ClearCastingSequence() { CurrentPowerSymbol = null; currentSequence = new List <ISpellSymbol>(); }
protected override PotionSpell ApplySpellEffect(ILiveEntity entity, IPowerSymbol powerSymbol, int skillLevel) { return(new PotionSpell(powerSymbol, this)); }
protected override ISpell ApplySpellEffect(ILiveEntity entity, IPowerSymbol powerSymbol, int skillLevel) { throw new NotImplementedException(); }
protected override ExplosionProjectilSpell <TImpact> ApplySpellEffect(ILiveEntity entity, IPowerSymbol powerSymbol, int skillLevel) { int kineticEnergy = MathHelper.Clamp(21, (powerSymbol.LevelOrdinal + 2) * (4 + (skillLevel << 1)), 255); var values = F327_kzzz_CHAMPION_IsProjectileSpellCast(entity, kineticEnergy, 0); if (values != null) { var val = values.Value; var res = new ExplosionProjectilSpell <TImpact>(val.KineticEnergy, val.StepEnergy, val.Attack); res.Projectile.Renderer = RenderersSource.GetProjectileSpellRenderer(res.Projectile, Texture); return(res); } else { return(null); } }
public PotionSpell(IPowerSymbol powerSymbol, PotionSpellFactory factory) { Factory = factory; PowerSymbol = powerSymbol; }