public JobDriverHolder(AbilityEffect_Cast owner, JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable <Thing> targets, IExposable effectState) { this.owner = owner; this.jobDriver = jobDriver; this.effectState = effectState; this.caster = caster; this.targets = targets; }
public override IEnumerable <Toil> MakeNewToils(JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable <Thing> targets, IExposable effectState) { JobDriverHolder holder = new JobDriverHolder(this, jobDriver, caster, targets, effectState); Toil toil = new Toil(); if (this.canBeInterrupted) { Log.Warning("//toil.damageTakenAction = holder.OnDamageTaken;"); //toil.damageTakenAction = holder.OnDamageTaken; } toil.initAction = holder.OnStartCast; toil.defaultCompleteMode = ToilCompleteMode.Delay; toil.defaultDuration = this.castTime; toil.AddFinishAction(holder.OnInterruptDamageTaken); yield return(toil); toil = new Toil(); toil.initAction = holder.OnFinishCast; toil.defaultCompleteMode = ToilCompleteMode.Instant; yield return(toil); }
public override IEnumerable<Toil> MakeNewToils(JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable<Thing> targets, IExposable effectState) { AbilityEffect_RandomState typedState = (AbilityEffect_RandomState)effectState; return this.items[typedState.item].MakeNewToils(jobDriver, caster, targets, typedState.effectState); }
public abstract IEnumerable<Toil> MakeNewToils(JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable<Thing> targets, IExposable effectState);
public abstract IEnumerable <Toil> MakeNewToils(JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable <Thing> targets, IExposable effectState);
public override IEnumerable <Toil> MakeNewToils(JobDriver_AbilityEffect jobDriver, Saveable_Caster caster, IEnumerable <Thing> targets, IExposable effectState) { AbilityEffect_RandomState typedState = (AbilityEffect_RandomState)effectState; return(this.items[typedState.item].MakeNewToils(jobDriver, caster, targets, typedState.effectState)); }