Remove CHOMPEdit codes + _ch files added, given upstream ports in progress

As stated, per maintainer/headmin request (and common sense).
This commit is contained in:
Rykka
2022-04-07 02:16:57 -06:00
parent 0e3b6a9ba9
commit 50b98e7f35
11 changed files with 50 additions and 87 deletions

View File

@@ -103,6 +103,12 @@
#define ui_alien_fire "EAST-1:28,NORTH-3:25"
#define ui_alien_oxygen "EAST-1:28,NORTH-4:25"
// Goes above HUD, mid-right
#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25"
#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27"
#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29"
#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31"
//Middle right (status indicators)
#define ui_temp "EAST-1:28,CENTER-2:13"
#define ui_health "EAST-1:28,CENTER-1:15"

View File

@@ -1,8 +0,0 @@
/** CHOMP-Specific Defines
* Put defines specific to OUR HUDs here.
* First thing to go here is the TGMC Ammo HUD.
*/
#define ui_ammo_hud1 "EAST-1:28,CENTER+1:25"
#define ui_ammo_hud2 "EAST-1:28,CENTER+2:27"
#define ui_ammo_hud3 "EAST-1:28,CENTER+3:29"
#define ui_ammo_hud4 "EAST-1:28,CENTER+4:31"

View File

@@ -470,9 +470,7 @@ var/list/global_huds = list(
/* TGMC Ammo HUD Port
* These procs call to screen_objects.dm's respective procs.
* All these do is manage the amount of huds on screen and set the HUD.
* CHOMPEdit: Commented out, just uncomment once Polaris merges + it comes down from VORE.
*/
/*
///Add an ammo hud to the user informing of the ammo count of G
/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G)
if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE)
@@ -501,4 +499,3 @@ var/list/global_huds = list(
/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G)
var/obj/screen/ammo/ammo_hud = ammo_hud_list[G]
ammo_hud?.update_hud(user, G)
*/

View File

@@ -1,32 +0,0 @@
/**
* CHOMP-Specific HUD override. This will be backported to Polaris if they want it.
* Comment this out once Polaris has it!
*/
///Add an ammo hud to the user informing of the ammo count of G
/datum/hud/proc/add_ammo_hud(mob/living/user, obj/item/weapon/gun/G)
if(length(ammo_hud_list) >= MAX_AMMO_HUD_POSSIBLE)
return
var/obj/screen/ammo/ammo_hud = new
ammo_hud_list[G] = ammo_hud
ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[length(ammo_hud_list)]
ammo_hud.add_hud(user, G)
ammo_hud.update_hud(user, G)
///Remove the ammo hud related to the gun G from the user
/datum/hud/proc/remove_ammo_hud(mob/living/user, obj/item/weapon/gun/G)
var/obj/screen/ammo/ammo_hud = ammo_hud_list[G]
if(isnull(ammo_hud))
return
ammo_hud.remove_hud(user, G)
qdel(ammo_hud)
ammo_hud_list -= G
var/i = 1
for(var/key in ammo_hud_list)
ammo_hud = ammo_hud_list[key]
ammo_hud.screen_loc = ammo_hud.ammo_screen_loc_list[i]
i++
///Update the ammo hud related to the gun G
/datum/hud/proc/update_ammo_hud(mob/living/user, obj/item/weapon/gun/G)
var/obj/screen/ammo/ammo_hud = ammo_hud_list[G]
ammo_hud?.update_hud(user, G)

View File

@@ -452,7 +452,6 @@
//YAWNEDIT: Knockdown code end
// CHOMPEdit: TGMC Ammo HUD insertion:
user.hud_used.update_ammo_hud(user, src)
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
@@ -778,9 +777,35 @@
var/datum/firemode/new_mode = firemodes[sel_mode]
new_mode.apply_to(src)
to_chat(user, "<span class='notice'>\The [src] is now set to [new_mode.name].</span>")
user.hud_used.update_ammo_hud(user, src) // CHOMPEdit: TGMC Ammo HUD
user.hud_used.update_ammo_hud(user, src)
return new_mode
/obj/item/weapon/gun/attack_self(mob/user)
switch_firemodes(user)
/* TGMC Ammo HUD Port Begin */
/obj/item/weapon/gun
var/hud_enabled = TRUE
/obj/item/weapon/gun/proc/has_ammo_counter()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_type()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_count()
return FALSE
/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible.
if(slot == slot_l_hand || slot == slot_r_hand)
user.hud_used.add_ammo_hud(user, src)
else
user.hud_used.remove_ammo_hud(user, src)
return ..()
/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti.
user.hud_used.remove_ammo_hud(user, src)
..()

View File

@@ -1,28 +1,3 @@
/obj/item/weapon/gun
var/holy = 0 //For Divinely blessed guns
/* TGMC Ammo HUD Port Begin */
/obj/item/weapon/gun
var/hud_enabled = TRUE
/obj/item/weapon/gun/proc/has_ammo_counter()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_type()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_count()
return FALSE
/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible.
if(slot == slot_l_hand || slot == slot_r_hand)
user.hud_used.add_ammo_hud(user, src)
else
user.hud_used.remove_ammo_hud(user, src)
return ..()
/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti.
user.hud_used.remove_ammo_hud(user, src)
..()

View File

@@ -55,8 +55,8 @@
if(handle_casings != HOLD_CASINGS)
ammo_magazine.stored_ammo -= chambered
var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD
if(istype(M)) // CHOMPEdit: TGMC Ammo HUD
var/mob/living/M = loc
if(istype(M))
M?.hud_used.update_ammo_hud(M, src)
if (chambered)
@@ -103,8 +103,8 @@
if(handle_casings != HOLD_CASINGS)
chambered = null
var/mob/living/M = loc // CHOMPEdit: TGMC Ammo HUD
if(istype(M)) // CHOMPEdit: TGMC Ammo HUD
var/mob/living/M = loc
if(istype(M))
M?.hud_used.update_ammo_hud(M, src)

View File

@@ -140,6 +140,10 @@
var/list/impacted_mobs = list()
// TGMC Ammo HUD Port
var/hud_state = "unknown" // What HUD state we use when we have ammunition.
var/hud_state_empty = "unknown" // The empty state. DON'T USE _FLASH IN THE NAME OF THE EMPTY STATE STRING, THAT IS ADDED BY THE CODE.
/obj/item/projectile/proc/Range()
range--
if(range <= 0 && loc)

View File

@@ -72,33 +72,33 @@
/obj/item/projectile/bullet/pistol // 9mm pistols and most SMGs. Sacrifice power for capacity.
fire_sound = 'sound/weapons/gunshot2.ogg'
damage = 20
hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state_empty = "pistol_empty" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol"
hud_state_empty = "pistol_empty"
/obj/item/projectile/bullet/pistol/ap
damage = 15
armor_penetration = 30
hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol_light_ap"
/obj/item/projectile/bullet/pistol/hp
damage = 25
armor_penetration = -50
hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol_ap"
/obj/item/projectile/bullet/pistol/medium // .45 (and maybe .40 if it ever gets added) caliber security pistols. Balance between capacity and power.
fire_sound = 'sound/weapons/gunshot3.ogg' // Snappier sound.
damage = 25
hud_state = "pistol" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol"
/obj/item/projectile/bullet/pistol/medium/ap
damage = 20
armor_penetration = 15
hud_state = "pistol_light_ap" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol_light_ap"
/obj/item/projectile/bullet/pistol/medium/hp
damage = 30
armor_penetration = -50
hud_state = "pistol_ap" // CHOMPEdit: Putting these here for easier upstream porting.
hud_state = "pistol_ap"
/obj/item/projectile/bullet/pistol/strong // .357 and .44 caliber stuff. High power pistols like the Mateba or Desert Eagle. Sacrifice capacity for power.
fire_sound = 'sound/weapons/gunshot4.ogg'

View File

@@ -1,8 +1,6 @@
/obj/item/projectile
/// If this projectile is holy. Silver bullets, etc. Currently no effects.
var/holy = 0
var/hud_state = "unknown" // TGMC Ammo HUD Port
var/hud_state_empty = "unknown" // TGMC Ammo HUD Port
/obj/item/projectile/bullet/pellet/shotgun/silver
name = "shrapnel"

View File

@@ -169,7 +169,6 @@
#include "code\_onclick\rig.dm"
#include "code\_onclick\telekinesis.dm"
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\_defines_ch.dm"
#include "code\_onclick\hud\_defines_vr.dm"
#include "code\_onclick\hud\ability_screen_objects.dm"
#include "code\_onclick\hud\action.dm"
@@ -181,7 +180,6 @@
#include "code\_onclick\hud\ghost.dm"
#include "code\_onclick\hud\gun_mode.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\hud_ch.dm"
#include "code\_onclick\hud\human.dm"
#include "code\_onclick\hud\map_popups.dm"
#include "code\_onclick\hud\minihud.dm"