public override bool TryStart(AbilityDef ability, Saveable_Caster caster, ref List<Thing> targets, ref IExposable effectState) { AbilityEffect_RandomState state = new AbilityEffect_RandomState(); state.item = Rand.Range(0, this.items.Count); effectState = state; return this.items[state.item].TryStart(ability, caster, ref targets, ref state.effectState); }
public override bool TryStart(AbilityDef ability, Saveable_Caster caster, ref List <Thing> targets, ref IExposable effectState) { AbilityEffect_RandomState state = new AbilityEffect_RandomState(); state.item = Rand.Range(0, this.items.Count); effectState = state; return(this.items[state.item].TryStart(ability, caster, ref targets, ref state.effectState)); }
public override void ExecuteWhileIncapacitated(Saveable_Caster caster, IEnumerable <Thing> targets, IExposable effectState) { AbilityEffect_RandomState typedState = (AbilityEffect_RandomState)effectState; this.items[typedState.item].ExecuteWhileIncapacitated(caster, targets, typedState.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)); }
public override JobDef StartJob(IExposable effectState) { AbilityEffect_RandomState typedState = (AbilityEffect_RandomState)effectState; return(this.items[typedState.item].StartJob(typedState.effectState)); }