Families wanted stars now only show up when you are involved in it, and announcements for wanted level changes (#50283)

* Wanted level stuff

* fuck

* Update code/game/gamemodes/gang/gang.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Update code/_onclick/hud/families.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Update code/game/gamemodes/gang/gang.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Update code/modules/antagonists/gang/gang.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

* Update code/modules/antagonists/ert/ert.dm

Co-Authored-By: Rohesie <rohesie@gmail.com>

Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
keronshb
2021-10-12 14:03:33 -04:00
parent 41013ec815
commit d88933b492
6 changed files with 135 additions and 58 deletions
+27
View File
@@ -0,0 +1,27 @@
/obj/screen/wanted
name = "Space Police Alertness"
desc = "Shows the current level of hostility the space police is planning to rain down on you. Better be careful."
icon = 'icons/obj/gang/wanted_160x32.dmi'
icon_state = "wanted_0"
screen_loc = ui_wanted_lvl
///Wanted level, affects the hud icon.
var/level
///Boolean, have the cops arrived? If so, the icon stops changing and remains the same.
var/cops_arrived
/obj/screen/wanted/Initialize()
. = ..()
var/datum/game_mode/gang/F = SSticker.mode
level = F.wanted_level
cops_arrived = F.cops_arrived
update_icon()
/obj/screen/wanted/MouseEntered(location,control,params)
openToolTip(usr,src,params,title = name,content = desc, theme = "alerttooltipstyle")
/obj/screen/wanted/MouseExited()
closeToolTip(usr)
/obj/screen/wanted/update_icon_state()
. = ..()
icon_state = "wanted_[level][cops_arrived ? "_active" : ""]"
+1 -5
View File
@@ -81,11 +81,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
plane_masters["[instance.plane]"] = instance
instance.backdrop(mymob)
wanted_lvl = new /obj/screen()
wanted_lvl.icon = 'icons/obj/gang/wanted_160x32.dmi'
wanted_lvl.icon_state = "wanted_0"
wanted_lvl.screen_loc = ui_wanted_lvl
infodisplay += wanted_lvl
owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness)
/datum/hud/Destroy()
+90 -53
View File
@@ -41,10 +41,9 @@ GLOBAL_VAR_INIT(deaths_during_shift, 0)
var/gangs_still_alive = 0
var/sent_announcement = FALSE
var/list/gang_locations = list()
var/lock_stars = FALSE
var/cops_arrived = FALSE
var/gang_balance_cap = 5
var/current_stars = "wanted_0"
var/wanted_level = 0
/datum/game_mode/gang/warriors
name = "Warriors"
@@ -179,44 +178,7 @@ GLOBAL_VAR_INIT(deaths_during_shift, 0)
return FALSE
/datum/game_mode/gang/process()
if(sent_announcement)
for(var/mob/M in GLOB.player_list)
if(M.hud_used && !istype(M, /mob/dead/new_player))
var/datum/hud/H = M.hud_used
var/icon_state_to_use = "wanted_1"
if(lock_stars)
H.wanted_lvl.icon_state = current_stars
continue
if(GLOB.joined_player_list.len > LOWPOP_FAMILIES_COUNT)
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_HIGHPOP-1)
icon_state_to_use = "wanted_1"
if(TWO_STARS_HIGHPOP to THREE_STARS_HIGHPOP-1)
icon_state_to_use = "wanted_2"
if(THREE_STARS_HIGHPOP to FOUR_STARS_HIGHPOP-1)
icon_state_to_use = "wanted_3"
if(FOUR_STARS_HIGHPOP to FIVE_STARS_HIGHPOP-1)
icon_state_to_use = "wanted_4"
if(FIVE_STARS_HIGHPOP to INFINITY)
icon_state_to_use = "wanted_5"
else
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_LOW-1)
icon_state_to_use = "wanted_1"
if(TWO_STARS_LOW to THREE_STARS_LOW-1)
icon_state_to_use = "wanted_2"
if(THREE_STARS_LOW to FOUR_STARS_LOW-1)
icon_state_to_use = "wanted_3"
if(FOUR_STARS_LOW to FIVE_STARS_LOW-1)
icon_state_to_use = "wanted_4"
if(FIVE_STARS_LOW to INFINITY)
icon_state_to_use = "wanted_5"
if(cops_arrived)
icon_state_to_use += "_active"
lock_stars = TRUE
current_stars = icon_state_to_use
H.wanted_lvl.icon_state = icon_state_to_use
check_wanted_level()
check_counter++
if(check_counter >= 5)
if (world.time > endtime && !fuckingdone)
@@ -229,61 +191,136 @@ GLOBAL_VAR_INIT(deaths_during_shift, 0)
check_gang_clothes()
check_rollin_with_crews()
///Checks if our wanted level has changed. Only actually does something post the initial announcement and until the cops are here. After that its locked.
/datum/game_mode/gang/proc/check_wanted_level()
if(!sent_announcement || cops_arrived)
return
var/new_wanted_level
if(GLOB.joined_player_list.len > LOWPOP_FAMILIES_COUNT)
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_HIGHPOP-1)
new_wanted_level = 1
if(TWO_STARS_HIGHPOP to THREE_STARS_HIGHPOP-1)
new_wanted_level = 2
if(THREE_STARS_HIGHPOP to FOUR_STARS_HIGHPOP-1)
new_wanted_level = 3
if(FOUR_STARS_HIGHPOP to FIVE_STARS_HIGHPOP-1)
new_wanted_level = 4
if(FIVE_STARS_HIGHPOP to INFINITY)
new_wanted_level = 5
else
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_LOW-1)
new_wanted_level = 1
if(TWO_STARS_LOW to THREE_STARS_LOW-1)
new_wanted_level = 2
if(THREE_STARS_LOW to FOUR_STARS_LOW-1)
new_wanted_level = 3
if(FOUR_STARS_LOW to FIVE_STARS_LOW-1)
new_wanted_level = 4
if(FIVE_STARS_LOW to INFINITY)
new_wanted_level = 5
if(wanted_level == new_wanted_level) //Same shit, dont care.
return
update_wanted_level(new_wanted_level)
///Updates the icon states for everyone and sends outs announcements regarding the police.
/datum/game_mode/gang/proc/update_wanted_level(newlevel)
if(newlevel > wanted_level)
on_gain_wanted_level(newlevel)
else if (newlevel < wanted_level)
on_lower_wanted_level(newlevel)
for(var/i in GLOB.player_list)
var/mob/M = i
if(!M.hud_used?.wanted_lvl)
continue
var/datum/hud/H = M.hud_used
H.wanted_lvl.level = newlevel
H.wanted_lvl.cops_arrived = cops_arrived
H.wanted_lvl.update_icon()
/datum/game_mode/gang/proc/on_gain_wanted_level(newlevel)
var/announcement_message
switch(newlevel)
if(2)
announcement_message = "Small amount of police vehicles have been spotted en route towards [station_name()]."
if(3)
announcement_message = "A large detachment police vehicles have been spotted en route towards [station_name()]."
if(4)
announcement_message = "A detachment of top-trained agents has been spotted on their way to [station_name()]."
if(5)
announcement_message = "The fleet enroute to [station_name()] now consists of national guard personnel."
priority_announce(announcement_message, "Station Spaceship Detection Systems")
/datum/game_mode/gang/proc/on_lower_wanted_level(newlevel)
var/announcement_message
switch(newlevel)
if(1)
announcement_message = "There are now only a few police vehicle headed towards [station_name()]."
if(2)
announcement_message = "There seem to be fewer police vehicles headed towards [station_name()]."
if(3)
announcement_message = "There are no longer top-trained agents in the fleet headed towards [station_name()]."
if(4)
announcement_message = "The convoy enroute to [station_name()] seems to no longer consist of national guard personnel."
priority_announce(announcement_message, "Station Spaceship Detection Systems")
/datum/game_mode/gang/proc/send_in_the_fuzz()
var/team_size
var/cops_to_send
var/announcement_message = "PUNK ASS BALLA BITCH"
var/announcer = "Spinward Stellar Coalition"
if(GLOB.joined_player_list.len > LOWPOP_FAMILIES_COUNT)
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_HIGHPOP-1)
switch(wanted_level)
if(1)
team_size = 8
cops_to_send = /datum/antagonist/ert/families/beatcop
announcement_message = "Hello, crewmembers of [station_name()]! We've received a few calls about some potential violent gang activity on board your station, so we're sending some beat cops to check things out. Nothing extreme, just a courtesy call. However, while they check things out for about 10 minutes, we're going to have to ask that you keep your escape shuttle parked.\n\nHave a pleasant day!"
announcer = "Spinward Stellar Coalition Police Department"
if(TWO_STARS_HIGHPOP to THREE_STARS_HIGHPOP-1)
if(2)
team_size = 9
cops_to_send = /datum/antagonist/ert/families/beatcop/armored
announcement_message = "Crewmembers of [station_name()]. We have received confirmed reports of violent gang activity from your station. We are dispatching some armed officers to help keep the peace and investigate matters. Do not get in their way, and comply with any and all requests from them. We have blockaded the local warp gate, and your shuttle cannot depart for another 10 minutes.\n\nHave a secure day."
announcer = "Spinward Stellar Coalition Police Department"
if(THREE_STARS_HIGHPOP to FOUR_STARS_HIGHPOP-1)
if(3)
team_size = 10
cops_to_send = /datum/antagonist/ert/families/beatcop/swat
announcement_message = "Crewmembers of [station_name()]. We have received confirmed reports of extreme gang activity from your station resulting in heavy civilian casualties. The Spinward Stellar Coalition does not tolerate abuse towards our citizens, and we will be responding in force to keep the peace and reduce civilian casualties. We have your station surrounded, and all gangsters must drop their weapons and surrender peacefully.\n\nHave a secure day."
announcer = "Spinward Stellar Coalition Police Department"
if(FOUR_STARS_HIGHPOP to FIVE_STARS_HIGHPOP-1)
if(4)
team_size = 11
cops_to_send = /datum/antagonist/ert/families/beatcop/fbi
announcement_message = "We are dispatching our top agents to [station_name()] at the request of the Spinward Stellar Coalition government due to an extreme terrorist level threat against this Nanotrasen owned station. All gangsters must surrender IMMEDIATELY. Failure to comply can and will result in death. We have blockaded your warp gates and will not allow any escape until the situation is resolved within our standard response time of 10 minutes.\n\nSurrender now or face the consequences of your actions."
announcer = "Federal Bureau of Investigation"
if(FIVE_STARS_HIGHPOP to INFINITY)
if(5)
team_size = 12
cops_to_send = /datum/antagonist/ert/families/beatcop/military
announcement_message = "Due to an insane level of civilian casualties aboard [station_name()], we have dispatched the National Guard to curb any and all gang activity on board the station. We have heavy cruisers watching the shuttle. Attempt to leave before we allow you to, and we will obliterate your station and your escape shuttle.\n\nYou brought this on yourselves by murdering so many civilians."
announcer = "Spinward Stellar Coalition National Guard"
else
switch(GLOB.deaths_during_shift)
if(0 to TWO_STARS_LOW-1)
switch(wanted_level)
if(1)
team_size = 5
cops_to_send = /datum/antagonist/ert/families/beatcop
announcement_message = "Hello, crewmembers of [station_name()]! We've received a few calls about some potential violent gang activity on board your station, so we're sending some beat cops to check things out. Nothing extreme, just a courtesy call. However, while they check things out for about 10 minutes, we're going to have to ask that you keep your escape shuttle parked.\n\nHave a pleasant day!"
announcer = "Spinward Stellar Coalition Police Department"
if(TWO_STARS_LOW to THREE_STARS_LOW-1)
if(2)
team_size = 6
cops_to_send = /datum/antagonist/ert/families/beatcop/armored
announcement_message = "Crewmembers of [station_name()]. We have received confirmed reports of violent gang activity from your station. We are dispatching some armed officers to help keep the peace and investigate matters. Do not get in their way, and comply with any and all requests from them. We have blockaded the local warp gate, and your shuttle cannot depart for another 10 minutes.\n\nHave a secure day."
announcer = "Spinward Stellar Coalition Police Department"
if(THREE_STARS_LOW to FOUR_STARS_LOW-1)
if(3)
team_size = 7
cops_to_send = /datum/antagonist/ert/families/beatcop/swat
announcement_message = "Crewmembers of [station_name()]. We have received confirmed reports of extreme gang activity from your station resulting in heavy civilian casualties. The Spinward Stellar Coalition does not tolerate abuse towards our citizens, and we will be responding in force to keep the peace and reduce civilian casualties. We have your station surrounded, and all gangsters must drop their weapons and surrender peacefully.\n\nHave a secure day."
announcer = "Spinward Stellar Coalition Police Department"
if(FOUR_STARS_LOW to FIVE_STARS_LOW-1)
if(4)
team_size = 8
cops_to_send = /datum/antagonist/ert/families/beatcop/fbi
announcement_message = "We are dispatching our top agents to [station_name()] at the request of the Spinward Stellar Coalition government due to an extreme terrorist level threat against this Nanotrasen owned station. All gangsters must surrender IMMEDIATELY. Failure to comply can and will result in death. We have blockaded your warp gates and will not allow any escape until the situation is resolved within our standard response time of 10 minutes.\n\nSurrender now or face the consequences of your actions."
announcer = "Federal Bureau of Investigation"
if(FIVE_STARS_LOW to INFINITY)
if(5)
team_size = 10
cops_to_send = /datum/antagonist/ert/families/beatcop/military
announcement_message = "Due to an insane level of civilian casualties aboard [station_name()], we have dispatched the National Guard to curb any and all gang activity on board the station. We have heavy cruisers watching the shuttle. Attempt to leave before we allow you to, and we will obliterate your station and your escape shuttle.\n\nYou brought this on yourselves by murdering so many civilians."
@@ -324,7 +361,7 @@ GLOBAL_VAR_INIT(deaths_during_shift, 0)
log_game("[key_name(cop)] has been selected as an [ert_antag.name]")
numagents--
cops_arrived = TRUE
SSshuttle.registerHostileEnvironment(src)
update_wanted_level() //Will make sure our icon updates properly
addtimer(CALLBACK(src, .proc/end_hostile_sit), 10 MINUTES)
return TRUE
+8
View File
@@ -179,11 +179,19 @@
..()
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
if(M.hud_used)
var/datum/hud/H = M.hud_used
H.wanted_lvl = new /obj/screen/wanted
H.infodisplay += H.wanted_lvl
/datum/antagonist/ert/families/remove_innate_effects(mob/living/mob_override)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
if(M.hud_used)
var/datum/hud/H = M.hud_used
H.infodisplay -= H.wanted_lvl
QDEL_NULL(H.wanted_lvl)
..()
/datum/antagonist/ert/families/greet()
+8
View File
@@ -106,12 +106,20 @@
package_spawner.my_gang_datum = src
var/mob/living/M = mob_override || owner.current
add_antag_hud(antag_hud_type, antag_hud_name, M)
if(M.hud_used)
var/datum/hud/H = M.hud_used
H.wanted_lvl = new /obj/screen/wanted
H.infodisplay += H.wanted_lvl
/datum/antagonist/gang/remove_innate_effects(mob/living/mob_override)
if(starter_gangster)
package_spawner.Remove(owner.current)
var/mob/living/M = mob_override || owner.current
remove_antag_hud(antag_hud_type, M)
if(M.hud_used)
var/datum/hud/H = M.hud_used
H.infodisplay -= H.wanted_lvl
QDEL_NULL(H.wanted_lvl)
..()
/// Gives a gangster their equipment in their backpack and / or pockets.
+1
View File
@@ -261,6 +261,7 @@
#include "code\_onclick\hud\credits.dm"
#include "code\_onclick\hud\devil.dm"
#include "code\_onclick\hud\drones.dm"
#include "code\_onclick\hud\families.dm"
#include "code\_onclick\hud\fullscreen.dm"
#include "code\_onclick\hud\generic_dextrous.dm"
#include "code\_onclick\hud\ghost.dm"