//[HarmonyPrefix] //[HarmonyPatch("Die")] public static bool DiePreFix(Agent __instance, Blow b, Agent.KillInfo overrideKillInfo = Agent.KillInfo.Invalid) { if (Main.Enable) { if (!Main.agentToDice.ContainsKey(__instance)) { Main.agentToDice.Add(__instance, new AgentToDie(__instance, b, overrideKillInfo)); } return(false); } return(true); }
public KillingBlow( Blow b, Vec3 ragdollImpulsePoint, Vec3 ragdollImpulseAmount, int deathAction, int weaponItemKind, Agent.KillInfo overrideKillInfo = Agent.KillInfo.Invalid) { this.RagdollImpulseLocalPoint = ragdollImpulsePoint; this.RagdollImpulseAmount = ragdollImpulseAmount; this.DeathAction = deathAction; this.OverrideKillInfo = overrideKillInfo; this.DamageType = b.DamageType; this.AttackType = b.AttackType; this.OwnerId = b.OwnerId; this.BoneIndex = b.BoneIndex; this.WeaponClass = (int)b.WeaponRecord.WeaponClass; this.BlowPosition = b.Position; this.WeaponRecordWeaponFlags = b.WeaponRecord.WeaponFlags; this.WeaponItemKind = weaponItemKind; this.InflictedDamage = b.InflictedDamage; this.IsMissile = b.IsMissile; this.IsValid = true; }