private static bool <ExposeData> m__0(Verb x) { return(x == null); }
public virtual void Notify_PawnUsedVerb(Verb verb, LocalTargetInfo target) { }
public float AdjustedFullCycleTime(Verb ownerVerb, Pawn attacker) { return(this.warmupTime + this.AdjustedCooldown(ownerVerb, attacker) + ((this.burstShotCount - 1) * this.ticksBetweenBurstShots).TicksToSeconds()); }
public int AdjustedCooldownTicks(Verb ownerVerb, Pawn attacker, Thing equipment) { return(this.AdjustedCooldown(ownerVerb, attacker, equipment).SecondsToTicks()); }
public static bool IsEMP(this Verb verb) { return(verb.GetDamageDef() == DamageDefOf.EMP); }
public static float InitialVerbWeight(Verb v, Pawn p) { return(DPS(v, p) * AdditionalSelectionFactor(v)); }
public static ShotReport HitReportFor(Thing caster, Verb verb, LocalTargetInfo target) { Pawn pawn = caster as Pawn; IntVec3 cell = target.Cell; ShotReport result; result.distance = (cell - caster.Position).LengthHorizontal; result.target = target.ToTargetInfo(caster.Map); float f; if (pawn != null) { f = pawn.GetStatValue(StatDefOf.ShootingAccuracy, true); } else { f = 0.96f; } result.factorFromShooterAndDist = Mathf.Pow(f, result.distance); if (result.factorFromShooterAndDist < 0.0201f) { result.factorFromShooterAndDist = 0.0201f; } result.factorFromEquipment = verb.verbProps.GetHitChanceFactor(verb.ownerEquipment, result.distance); result.covers = CoverUtility.CalculateCoverGiverSet(target, caster.Position, caster.Map); result.coversOverallBlockChance = CoverUtility.CalculateOverallBlockChance(target, caster.Position, caster.Map); result.coveringGas = null; if (verb.TryFindShootLineFromTo(verb.caster.Position, target, out result.shootLine)) { foreach (IntVec3 c in result.shootLine.Points()) { Thing gas = c.GetGas(caster.Map); if (gas != null && (result.coveringGas == null || result.coveringGas.gas.accuracyPenalty < gas.def.gas.accuracyPenalty)) { result.coveringGas = gas.def; } } } else { result.shootLine = new ShootLine(IntVec3.Invalid, IntVec3.Invalid); } if (!caster.Position.Roofed(caster.Map) || !target.Cell.Roofed(caster.Map)) { result.factorFromWeather = caster.Map.weatherManager.CurWeatherAccuracyMultiplier; } else { result.factorFromWeather = 1f; } if (target.HasThing) { Pawn pawn2 = target.Thing as Pawn; if (pawn2 != null) { result.factorFromTargetSize = pawn2.BodySize; } else { result.factorFromTargetSize = target.Thing.def.fillPercent * (float)target.Thing.def.size.x * (float)target.Thing.def.size.z * 1.7f; } result.factorFromTargetSize = Mathf.Clamp(result.factorFromTargetSize, 0.5f, 2f); } else { result.factorFromTargetSize = 1f; } result.forcedMissRadius = verb.verbProps.forcedMissRadius; return(result); }
public static bool ProjectileFliesOverhead(this Verb verb) { ThingDef projectile = verb.GetProjectile(); return(projectile != null && projectile.projectile.flyOverhead); }
public static bool ProjectileFliesOverhead(this Verb verb) { return(verb.GetProjectile()?.projectile.flyOverhead ?? false); }
public static bool HarmsHealth(this Verb verb) { return(verb.GetDamageDef()?.harmsHealth ?? false); }
public static bool IsIncendiary(this Verb verb) { return(verb.GetProjectile()?.projectile.ai_IsIncendiary ?? false); }
public static ThingDef GetProjectile(this Verb verb) { return((verb as Verb_LaunchProjectile)?.Projectile); }
public static float DPS(Verb v, Pawn p) { return(v.verbProps.AdjustedMeleeDamageAmount(v, p) * (1f + v.verbProps.AdjustedArmorPenetration(v, p)) * v.verbProps.accuracyTouch / v.verbProps.AdjustedFullCycleTime(v, p)); }
public static ThingDef GetProjectile(this Verb verb) { Verb_LaunchProjectile verb_LaunchProjectile = verb as Verb_LaunchProjectile; return((verb_LaunchProjectile == null) ? null : verb_LaunchProjectile.Projectile); }
public float AdjustedDamageAmount(Verb verb, Pawn caster) { return((float)this.amount * verb.verbProps.GetDamageFactorFor(verb, caster)); }
public static bool IsIncendiary(this Verb verb) { ThingDef projectile = verb.GetProjectile(); return(projectile != null && projectile.projectile.ai_IsIncendiary); }
private void InitVerbs(Func <Type, string, Verb> creator) { List <VerbProperties> verbProperties = this.directOwner.VerbProperties; if (verbProperties != null) { for (int i = 0; i < verbProperties.Count; i++) { try { VerbProperties verbProperties2 = verbProperties[i]; string text = Verb.CalculateUniqueLoadID(this.directOwner, i); this.InitVerb(creator(verbProperties2.verbClass, text), verbProperties2, this.directOwner, null, null, text); if (verbProperties2.LaunchesProjectile && !verbProperties2.onlyManualCast) { VerbProperties verbProperties3 = verbProperties2.MemberwiseClone(); verbProperties3.defaultCooldownTime += verbProperties3.warmupTime; verbProperties3.warmupTime = 0f; verbProperties3.meleeShoot = true; string text2 = Verb.CalculateUniqueLoadID(this.directOwner, -1 - i); this.InitVerb(creator(verbProperties2.verbClass, text2), verbProperties2, this.directOwner, null, null, text2); } } catch (Exception ex) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex })); } } } List <Tool> tools = this.directOwner.Tools; if (tools != null) { for (int j = 0; j < tools.Count; j++) { Tool tool = tools[j]; foreach (ManeuverDef current in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb = current.verb; string text3 = Verb.CalculateUniqueLoadID(this.directOwner, tool, current); this.InitVerb(creator(verb.verbClass, text3), verb, this.directOwner, tool, current, text3); } catch (Exception ex2) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex2 })); } } } } Pawn pawn = this.directOwner as Pawn; if (pawn != null && !pawn.def.tools.NullOrEmpty <Tool>()) { for (int k = 0; k < pawn.def.tools.Count; k++) { Tool tool = pawn.def.tools[k]; foreach (ManeuverDef current2 in from maneuver in DefDatabase <ManeuverDef> .AllDefsListForReading where tool.capacities.Contains(maneuver.requiredCapacity) select maneuver) { try { VerbProperties verb2 = current2.verb; string text4 = Verb.CalculateUniqueLoadID(this.directOwner, tool, current2); this.InitVerb(creator(verb2.verbClass, text4), verb2, this.directOwner, tool, current2, text4); } catch (Exception ex3) { Log.Error(string.Concat(new object[] { "Could not instantiate Verb (directOwner=", this.directOwner.ToStringSafe <IVerbOwner>(), "): ", ex3 })); } } } } }
public static bool HarmsHealth(this Verb verb) { DamageDef damageDef = verb.GetDamageDef(); return(damageDef != null && damageDef.harmsHealth); }
public int AdjustedCooldownTicks(Verb ownerVerb, Pawn attacker) { return(this.AdjustedCooldown(ownerVerb, attacker).SecondsToTicks()); }
public static bool UsesExplosiveProjectiles(this Verb verb) { ThingDef projectile = verb.GetProjectile(); return(projectile != null && projectile.projectile.explosionRadius > 0f); }
public Stance_Busy(int ticks, LocalTargetInfo focusTarg, Verb verb) { this.ticksLeft = ticks; this.focusTarg = focusTarg; this.verb = verb; }