Files
7d2dXG/Mods/zzz_REBIRTH__Utils/Scripts/MinEvents/MinEventActionSetSilencerSoundsRebirth.cs
Nathaniel Cosford e06f2bd282 Add All Mods
2025-05-29 23:33:28 +09:30

113 lines
6.6 KiB
C#

public class MinEventActionSetSilencerSoundsRebirth : MinEventActionTargetedBase
{
public override void Execute(MinEventParams _params)
{
var myEntity = _params.Self as EntityAlive;
if (myEntity == null)
return;
ItemValue item = ItemClass.GetItem("modGunSoundSuppressorSilencer", false);
ItemClass itemClass = item.ItemClass;
if (itemClass != null)
{
ItemActionAttack itemActionRanged = myEntity.inventory.GetHoldingGun();
string weaponName = myEntity.inventory.holdingItem.GetItemName().ToLower().Trim();
if (weaponName == "gunnpcsmg5")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "smg_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "smg_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "gunnpcpipepistol")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pistol_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pistol_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcpipeshotgun")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcpiperifle")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "hunting_rifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "hunting_rifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcpipemg")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "m60_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "m60_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "gunnpcm60")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "m60_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "m60_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "gunnpcpistol")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pistol_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pistol_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcdpistol")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcak47")
{
//Log.Out("MinEventActionSetSilencerSoundsRebirth-Execute: 2");
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "furiousramsaygunak47")
{
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_start"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_loop"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[0].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "gunnpctrifle")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "ak47_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "silencefiller";
}
else if (weaponName == "gunnpchrifle")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "hunting_rifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "hunting_rifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcsrifle")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "sniperrifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "sniperrifle_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcpshotgun")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
else if (weaponName == "gunnpcashotgun")
{
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_start"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_loop"] = "pump_shotgun_s_fire";
myEntity.inventory.holdingItem.Actions[1].Properties.Values["Sound_end"] = "";
}
myEntity.inventory.ForceHoldingItemUpdate();
}
}
}