public PsykerPower(Pawn user, PsykerPowerDef pdef) { this.pawn = user; this.powerdef = pdef; this.def = pdef; this.PowerButton = pdef.uiIcon; this.InitializePawnComps(user); }
public void AddPsykerPower(PsykerPowerDef psydef) { if (!this.compPsyker.Powers.Any(x => x.def.defName == psydef.defName)) { this.compPsyker.Powers.Add(new PsykerPower(this.compPsyker.psyker, psydef)); } this.compPsyker.UpdatePowers(); }
public PsykerPower(Pawn user) { this.pawn = user; PsykerPowerDef randdef = DefDatabase <PsykerPowerDef> .GetRandom(); this.powerdef = randdef; this.def = randdef; this.PowerButton = randdef.uiIcon; this.InitializePawnComps(user); }
public PsykerPowerEntry(PsykerPowerDef power, bool equipmentDependent = false, ThingDef depdef = null) { this.psykerPowerDef = power; if (depdef != null) { this.DependendOn = depdef; } if (equipmentDependent) { this.EquipmentDependent = true; } }
public void AddPsykerPower(PsykerPowerDef psydef, bool equipmentDependent = false, ThingDef depdef = null) { if (!this.compPsyker.learnedPowers.Any(x => x.def.defName == psydef.defName)) { this.compPsyker.learnedPowers.Add(new PsykerPower(this.compPsyker.psyker, psydef)); } if (!this.compPsyker.allpsykerPowers.Any(x => x.psykerPowerDef.defName == psydef.defName)) { this.compPsyker.allpsykerPowers.Add(new PsykerPowerEntry(psydef, equipmentDependent, depdef)); } this.compPsyker.UpdatePowers(); }
public static Action TryCastPowerAction(Pawn pawn, TargetInfo target, CompPsyker compPsyker, Verb_CastWarpPower verb, PsykerPowerDef psydef) { Action act = new Action(delegate { // compPsyker.TicksToCast = verb.warpverbprops.TicksToRecharge; // compPsyker.TicksToCastMax = verb.warpverbprops.TicksToRecharge; compPsyker.CurTarget = target; compPsyker.curVerb = verb; compPsyker.curPower = psydef; compPsyker.curRotation = target.Thing.Rotation; Job job = CompPsyker.PsykerJob(verb.warpverbprops.PsykerPowerCategory, target); job.playerForced = true; job.verbToUse = verb; Pawn pawn2 = target.Thing as Pawn; if (pawn2 != null) { job.killIncappedTarget = pawn2.Downed; } pawn.drafter.TakeOrderedJob(job); }); return(act); }