public PawnAbility(Pawn user, AbilityDef pdef) { pawn = user; powerdef = pdef; powerButton = pdef.uiIcon; //Log.Message("PawnAbility Created: " + this.Def.defName); }
private void AddAbilityInternal(AbilityDef abilityDef, List <PawnAbility> thelist, bool activenow, float savedTicks) { var pa = (PawnAbility)Activator.CreateInstance(abilityDef.abilityClass); pa.Pawn = AbilityUser; pa.Def = abilityDef; thelist.Add(pa); UpdateAbilities(); }
public void Launch(Thing launcher, AbilityDef abilityDef, Vector3 origin, LocalTargetInfo targ, ProjectileHitFlags hitFlags, Thing equipment = null, List <ApplyHediffs> applyHediffs = null, List <ApplyMentalStates> applyMentalStates = null, List <SpawnThings> spawnThings = null) { //Log.Message("Projectile_AbilityBase"); localApplyHediffs = applyHediffs; localApplyMentalStates = applyMentalStates; localSpawnThings = spawnThings; localAbilityDef = abilityDef; base.Launch(launcher, targ, targ, hitFlags, equipment); //TODO }
private void RemoveAbilityInternal(AbilityDef abilityDef, List <PawnAbility> thelist) { var abilityToRemove = thelist.FirstOrDefault(x => x.Def == abilityDef); if (abilityToRemove != null) { thelist.Remove(abilityToRemove); } abilityToRemove = AbilityData.Powers.FirstOrDefault(x => x.Def == abilityDef); if (abilityToRemove != null) { AbilityData.Powers.Remove(abilityToRemove); } UpdateAbilities(); }
// Token: 0x06002189 RID: 8585 RVA: 0x000CB488 File Offset: 0x000C9688 public override void DrawHighlight(LocalTargetInfo target) { AbilityDef def = this.ability.def; this.DrawRadius(); if (this.CanHitTarget(target) && this.IsApplicableTo(target, false)) { if (def.HasAreaOfEffect) { if (target.IsValid) { GenDraw.DrawTargetHighlight(target); GenDraw.DrawRadiusRing(target.Cell, def.EffectRadius, Verb_CastAbility.RadiusHighlightColor, null); } } else { GenDraw.DrawTargetHighlight(target); } } if (target.IsValid) { this.ability.DrawEffectPreviews(target); } this.verbProps.DrawRadiusRing(this.caster.Position); if (target.IsValid) { GenDraw.DrawTargetHighlight(target); bool flag; float num = this.HighlightFieldRadiusAroundTarget(out flag); ShootLine shootLine; if (num > 0.2f && this.TryFindShootLineFromTo(this.caster.Position, target, out shootLine)) { if (flag) { GenExplosion.RenderPredictedAreaOfEffect(shootLine.Dest, num); return; } GenDraw.DrawFieldEdges((from x in GenRadial.RadialCellsAround(shootLine.Dest, num, true) where x.InBounds(Find.CurrentMap) select x).ToList <IntVec3>()); } } }
public void RemoveApparelAbility(AbilityDef abilityDef) { RemoveAbilityInternal(abilityDef, AbilityData.TemporaryApparelPowers); }
public void RemoveWeaponAbility(AbilityDef abilityDef) { RemoveAbilityInternal(abilityDef, AbilityData.TemporaryWeaponPowers); }
public void RemovePawnAbility(AbilityDef abilityDef) { RemoveAbilityInternal(abilityDef, AbilityData.Powers); }
public void AddApparelAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1) { AddAbilityInternal(abilityDef, AbilityData.TemporaryApparelPowers, activenow, savedTicks); }
//public List<Verb_UseAbility> AbilityVerbs = new List<Verb_UseAbility>(); public void AddPawnAbility(AbilityDef abilityDef, bool activenow = true, float savedTicks = -1) { AddAbilityInternal(abilityDef, AbilityData.Powers, activenow, savedTicks); }