Example #1
0
 public void EndStrike(EffectId id)
 {
     if (CurrentStrikeOwner != id)
     {
         return;
     }
     CurrentStrikeOwner = default;
     _currentStrike     = null;
 }
Example #2
0
 public virtual void ProjectileHit(StrikeDef strike, EntityId targetId)
 {
     if (targetId == this.ParentEntity.Id)
     {
         return;
     }
     if (strike.PredicateOnTarget == null ||
         strike.PredicateOnTarget.Def.Check(new ScriptingContext(ParentEntity)
     {
         Host = targetId, Target = targetId, Parent = new ScriptingContext()
         {
             Host = ParentEntity.Id
         }
     }))
     {
         ((IHasSpells)ParentEntity).SpellsEngine.CastFromInsideEntity(new SpellCast()
         {
             Def = strike.SpellOnStrike.Def, OwnerObject = ParentEntity.Id, TargetEntity = targetId
         });
     }
 }
Example #3
0
 public void PrepareStrike(EffectId id, StrikeDef def)
 {
     CurrentStrikeOwner = id;
     _currentStrike     = def;
     _struckEntities.Clear();
 }