示例#1
0
 protected override SpellLevel GetLevelTemplate(int level)
 {
   LevelTemplate = new SpellLevel();
   // We only take effects with a duration or damage or healing effect into considération. Others are probably constant effects on the caster when holding the weapon. 
   LevelTemplate.effects = _weapon.possibleEffects.OfType<EffectInstanceDice>().Where(effect => (effect.duration != 0) || ((GetEffectCategories(effect.effectId, 0) & (SpellCategory.Damages | SpellCategory.Healing)) > 0)).ToList();
   foreach (var effect in LevelTemplate.effects)
     effect.rawZone = _weapon.type.rawZone;
   LevelTemplate.criticalEffect = LevelTemplate.effects;
   Level = 1;
   LevelTemplate.minRange = (uint)_weapon.minRange;
   LevelTemplate.range = (uint)_weapon.range;
   LevelTemplate.apCost = (uint)_weapon.apCost;
   LevelTemplate.castInDiagonal = _weapon.castInDiagonal;
   LevelTemplate.castInLine = _weapon.castInLine;
   LevelTemplate.castTestLos = _weapon.castTestLos;
   LevelTemplate.criticalHitProbability = (uint)_weapon.criticalHitProbability;
   LevelTemplate.criticalFailureProbability = (uint)_weapon.criticalFailureProbability;
   return LevelTemplate;
 }
示例#2
0
        public bool IsInSpellRange(Cell cell, SpellLevel spell)
        {
            var range = GetRealSpellRange(spell);
            var dist = Cell.DistanceTo(cell);

            return dist >= spell.minRange && dist <= range;
        }
示例#3
0
 private bool IsInLineIfNeeded(Cell cell, SpellLevel spell)
 {
   if (!spell.castInLine) return true;
   return Cell.X == cell.X || Cell.Y == cell.Y;
 }
示例#4
0
        public int GetRealSpellRange(SpellLevel spell)
        {
            var range =  (int) (spell.rangeCanBeBoosted ? Stats.Range + spell.range : spell.range);

            if (range < spell.minRange)
                return (int) spell.minRange;

            return range;
        }
示例#5
0
    public bool IsInSpellRange(Cell cell, SpellLevel spell)
    {
      var range = GetRealSpellRange(spell);
      var dist = Cell.ManhattanDistanceTo(cell);

      if (!(dist >= spell.minRange && dist <= range)) return false;
      return IsInLineIfNeeded(cell, spell);
    }