コード例 #1
0
 public PsykerPower(Pawn user, PsykerPowerDef pdef)
 {
     this.pawn        = user;
     this.powerdef    = pdef;
     this.def         = pdef;
     this.PowerButton = pdef.uiIcon;
     this.InitializePawnComps(user);
 }
コード例 #2
0
        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();
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public PsykerPowerEntry(PsykerPowerDef power, bool equipmentDependent = false, ThingDef depdef = null)
 {
     this.psykerPowerDef = power;
     if (depdef != null)
     {
         this.DependendOn = depdef;
     }
     if (equipmentDependent)
     {
         this.EquipmentDependent = true;
     }
 }
コード例 #5
0
        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();
        }
コード例 #6
0
ファイル: CompPsyker.cs プロジェクト: kaptain-kavern/YaWH40Km
        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);
        }