Files
crystall-punk-14/Content.Shared/Weapons/Ranged/Systems/BatteryWeaponFireModesSystem.cs

117 lines
3.8 KiB
C#
Raw Permalink Normal View History

using System.Linq;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
using Content.Shared.Verbs;
using Content.Shared.Weapons.Ranged.Components;
using Robust.Shared.Prototypes;
namespace Content.Shared.Weapons.Ranged.Systems;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
public sealed class BatteryWeaponFireModesSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BatteryWeaponFireModesComponent, ActivateInWorldEvent>(OnInteractHandEvent);
SubscribeLocalEvent<BatteryWeaponFireModesComponent, GetVerbsEvent<Verb>>(OnGetVerb);
SubscribeLocalEvent<BatteryWeaponFireModesComponent, ExaminedEvent>(OnExamined);
}
private void OnExamined(EntityUid uid, BatteryWeaponFireModesComponent component, ExaminedEvent args)
{
if (component.FireModes.Count < 2)
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
return;
var fireMode = GetMode(component);
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
if (!_prototypeManager.TryIndex<EntityPrototype>(fireMode.Prototype, out var proto))
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
return;
args.PushMarkup(Loc.GetString("gun-set-fire-mode", ("mode", proto.Name)));
}
private BatteryWeaponFireMode GetMode(BatteryWeaponFireModesComponent component)
{
return component.FireModes[component.CurrentFireMode];
}
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
private void OnGetVerb(EntityUid uid, BatteryWeaponFireModesComponent component, GetVerbsEvent<Verb> args)
{
if (!args.CanAccess || !args.CanInteract || args.Hands == null)
return;
if (component.FireModes.Count < 2)
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
return;
for (var i = 0; i < component.FireModes.Count; i++)
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
{
var fireMode = component.FireModes[i];
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
var entProto = _prototypeManager.Index<EntityPrototype>(fireMode.Prototype);
var index = i;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
var v = new Verb
{
Priority = 1,
Category = VerbCategory.SelectType,
Text = entProto.Name,
Disabled = i == component.CurrentFireMode,
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
Impact = LogImpact.Low,
DoContactInteraction = true,
Act = () =>
{
SetFireMode(uid, component, index, args.User);
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
}
};
args.Verbs.Add(v);
}
}
private void OnInteractHandEvent(EntityUid uid, BatteryWeaponFireModesComponent component, ActivateInWorldEvent args)
{
if (!args.Complex)
return;
if (component.FireModes.Count < 2)
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
return;
CycleFireMode(uid, component, args.User);
}
private void CycleFireMode(EntityUid uid, BatteryWeaponFireModesComponent component, EntityUid user)
{
if (component.FireModes.Count < 2)
return;
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
var index = (component.CurrentFireMode + 1) % component.FireModes.Count;
SetFireMode(uid, component, index, user);
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
}
private void SetFireMode(EntityUid uid, BatteryWeaponFireModesComponent component, int index, EntityUid? user = null)
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
{
var fireMode = component.FireModes[index];
component.CurrentFireMode = index;
Dirty(uid, component);
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
if (TryComp(uid, out ProjectileBatteryAmmoProviderComponent? projectileBatteryAmmoProvider))
{
if (!_prototypeManager.TryIndex<EntityPrototype>(fireMode.Prototype, out var prototype))
return;
projectileBatteryAmmoProvider.Prototype = fireMode.Prototype;
projectileBatteryAmmoProvider.FireCost = fireMode.FireCost;
if (user != null)
{
_popupSystem.PopupClient(Loc.GetString("gun-set-fire-mode", ("mode", prototype.Name)), uid, user.Value);
C.H.I.M.P handcannon redesign (#19004) * Added basic alternative fire mode system for the CHIMP * Redesign of the CHIMP handcannon - the CHIMP now has an internal rechargable battery (10 shots at 100% charge) - it has three alternative fire modes, one for each particle type, that its user can easily switch between - syndicate scientists have access to an experimental version which can also fire omega particles (4 TC) - each particle type now has a distinct color and damage type: delta (red): heat, epsilon (green): radiation, zeta (yellow): shock, omega (purple): heat + radiation. This affects A.P.E.s as well - CHIMP particles now do 10 damage (up from 5) - all CHIMP particle cartridges have been removed from the game (including the syndicate omega particle ammo pack) * Code revisions * Code revisions - Removed changes to particle damage and damage types - The experimental CHIMP was removed from the syndicate uplink and replaced with an upgrade kit, which when used on a standard CHIMP will convert it to an experimental one * Code revisions - Added a 2 second DoAfter for applying the upgrade kit * Fixed spelling mistake * Update projectiles.yml Removed commented code * Update Content.Server/Weapons/Ranged/Systems/AlternativeFireModesSystem.cs Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> * Code revisions - Implemented changes requested by EmoGarbage - Removed UpgradeKitComponent in favor of using a construction graph - Renamed AlternativeFireModesComponent.cs to BatteryWeaponFireModesComponent.cs Textures - Reverted omega particle to being a green color - Epsilon particles are now a cyan color * Added comments * Revisions - Moved BatteryWeaponFireModesComponent from Shared to Server - Restricted access to this component to BatteryWeaponFireModesSystem - Changed the CHIMP upgrade kit to a chip - Updated the localization files to reflect this change * Delete interaction-upgrade-kit-component.ftl This file is no longer needed * Update battery_guns.yml Added new description for the experimental CHIMP * Update battery_guns.yml Updated experimental CHIMP description again... * Fixed issue with ItemComponent --------- Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
2023-08-19 17:54:52 -05:00
}
}
}
}