Files
Yogstation/code/game/gamemodes/nuclear/nuclear.dm
Rob Bailey 6e4089224a [READY] I got guns (#41804)
cl actioninja\memager
refactor: Ballistic guns have been almost entirely reworked from a backend side. This primarily focused on moving as much as possible into the base ballistic gun and turning as many other guns into essentially varedits as possible.
add: Guns can now be racked. This is the default action unless the magazine is empty.
add: Guns now can have the magazine removed by clicking on them with an open hand while they are in hand.
tweak: Suppressors are now removed by alt clicking instead of clicking with an open hand
add: Guns now have various bolt types that all function a bit differently. Open bolts cannot have a bullet chambered with no mag, locking bolts lock back after running out of ammo, etc.
add: All ballistic gun sounds are controlled by variables instead of hardcoded usages.
tweak: The l6 LMG has a reworked control scheme. alt + click to open and close the cover, open hand to remove mag, place mag in by slapping them together, default action is rack.
tweak: Functionality that used to be snowflake code such as tactical reloads has been moved to the base gun, and can be toggled by variables.
refactor: All shotguns are now properly subpaths of the shotgun type. They still work the same.
imagedel: Gun sprites have been almost entirely overhauled to use overlays instead of states. This collapsed the L6 sprite from 20 sprites to 9 sprites to give an example.
soundadd: Remixed versions of the shotgun and base gun firesound
soundadd: New rifle firesound for l6 and moist nugget, new SMG fire sound, new sniper fire sound.
soundadd: Lots of new weapon operation sounds such as racking and bolts and the like.
imageadd: New sprites for the Riot Shotgun, Combat Shotgun, c20r, Deagle, m90, double barrel shotgun and 1911 by Memager.
imageadd: All gun sprites that were pointing to the left have been flipped to point to the right.
balance: Shotguns now can be pumped faster.
balance: Bulldog can now be tac reloaded
balance: Sawn off shotguns now have an accuracy penalty and recoil
/cl
2019-02-04 21:33:10 +01:00

174 lines
6.6 KiB
Plaintext

/datum/game_mode/nuclear
name = "nuclear emergency"
config_tag = "nuclear"
report_type = "nuclear"
false_report_weight = 10
required_players = 30 // 30 players - 3 players to be the nuke ops = 27 players remaining
required_enemies = 2
recommended_enemies = 5
antag_flag = ROLE_OPERATIVE
enemy_minimum_age = 14
announce_span = "danger"
announce_text = "Syndicate forces are approaching the station in an attempt to destroy it!\n\
<span class='danger'>Operatives</span>: Secure the nuclear authentication disk and use your nuke to destroy the station.\n\
<span class='notice'>Crew</span>: Defend the nuclear authentication disk and ensure that it leaves with you on the emergency shuttle."
var/const/agents_possible = 5 //If we ever need more syndicate agents.
var/nukes_left = 1 // Call 3714-PRAY right now and order more nukes! Limited offer!
var/list/pre_nukeops = list()
var/datum/team/nuclear/nuke_team
var/operative_antag_datum_type = /datum/antagonist/nukeop
var/leader_antag_datum_type = /datum/antagonist/nukeop/leader
/datum/game_mode/nuclear/pre_setup()
var/n_agents = min(round(num_players() / 10), antag_candidates.len, agents_possible)
if(n_agents >= required_enemies)
for(var/i = 0, i < n_agents, ++i)
var/datum/mind/new_op = pick_n_take(antag_candidates)
pre_nukeops += new_op
new_op.assigned_role = "Nuclear Operative"
new_op.special_role = "Nuclear Operative"
//log_game("[key_name(new_op)] has been selected as a nuclear operative") | yogs - redundant
return TRUE
else
setup_error = "Not enough nuke op candidates"
return FALSE
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
/datum/game_mode/nuclear/post_setup()
//Assign leader
var/datum/mind/leader_mind = pre_nukeops[1]
var/datum/antagonist/nukeop/L = leader_mind.add_antag_datum(leader_antag_datum_type)
nuke_team = L.nuke_team
//Assign the remaining operatives
for(var/i = 2 to pre_nukeops.len)
var/datum/mind/nuke_mind = pre_nukeops[i]
nuke_mind.add_antag_datum(operative_antag_datum_type)
return ..()
/datum/game_mode/nuclear/OnNukeExplosion(off_station)
..()
nukes_left--
/datum/game_mode/nuclear/check_win()
if (nukes_left == 0)
return TRUE
return ..()
/datum/game_mode/nuclear/check_finished()
//Keep the round going if ops are dead but bomb is ticking.
if(nuke_team.operatives_dead())
for(var/obj/machinery/nuclearbomb/N in GLOB.nuke_list)
if(N.proper_bomb && (N.timing || N.exploding))
return FALSE
return ..()
/datum/game_mode/nuclear/set_round_result()
..()
var result = nuke_team.get_result()
switch(result)
if(NUKE_RESULT_FLUKE)
SSticker.mode_result = "loss - syndicate nuked - disk secured"
SSticker.news_report = NUKE_SYNDICATE_BASE
if(NUKE_RESULT_NUKE_WIN)
SSticker.mode_result = "win - syndicate nuke"
SSticker.news_report = STATION_NUKED
if(NUKE_RESULT_NOSURVIVORS)
SSticker.mode_result = "halfwin - syndicate nuke - did not evacuate in time"
SSticker.news_report = STATION_NUKED
if(NUKE_RESULT_WRONG_STATION)
SSticker.mode_result = "halfwin - blew wrong station"
SSticker.news_report = NUKE_MISS
if(NUKE_RESULT_WRONG_STATION_DEAD)
SSticker.mode_result = "halfwin - blew wrong station - did not evacuate in time"
SSticker.news_report = NUKE_MISS
if(NUKE_RESULT_CREW_WIN_SYNDIES_DEAD)
SSticker.mode_result = "loss - evacuation - disk secured - syndi team dead"
SSticker.news_report = OPERATIVES_KILLED
if(NUKE_RESULT_CREW_WIN)
SSticker.mode_result = "loss - evacuation - disk secured"
SSticker.news_report = OPERATIVES_KILLED
if(NUKE_RESULT_DISK_LOST)
SSticker.mode_result = "halfwin - evacuation - disk not secured"
SSticker.news_report = OPERATIVE_SKIRMISH
if(NUKE_RESULT_DISK_STOLEN)
SSticker.mode_result = "halfwin - detonation averted"
SSticker.news_report = OPERATIVE_SKIRMISH
else
SSticker.mode_result = "halfwin - interrupted"
SSticker.news_report = OPERATIVE_SKIRMISH
/datum/game_mode/nuclear/generate_report()
return "One of Central Command's trading routes was recently disrupted by a raid carried out by the Gorlex Marauders. They seemed to only be after one ship - a highly-sensitive \
transport containing a nuclear fission explosive, although it is useless without the proper code and authorization disk. While the code was likely found in minutes, the only disk that \
can activate this explosive is on your station. Ensure that it is protected at all times, and remain alert for possible intruders."
/proc/is_nuclear_operative(mob/M)
return M && istype(M) && M.mind && M.mind.has_antag_datum(/datum/antagonist/nukeop)
/datum/outfit/syndicate
name = "Syndicate Operative - Basic"
uniform = /obj/item/clothing/under/syndicate
shoes = /obj/item/clothing/shoes/combat
gloves = /obj/item/clothing/gloves/combat
back = /obj/item/storage/backpack/fireproof
ears = /obj/item/radio/headset/syndicate/alt
l_pocket = /obj/item/pinpointer/nuke/syndicate
id = /obj/item/card/id/syndicate
belt = /obj/item/gun/ballistic/automatic/pistol
backpack_contents = list(/obj/item/storage/box/syndie=1,\
/obj/item/kitchen/knife/combat/survival)
var/tc = 25
var/command_radio = FALSE
var/uplink_type = /obj/item/uplink/nuclear
/datum/outfit/syndicate/leader
name = "Syndicate Leader - Basic"
id = /obj/item/card/id/syndicate/nuke_leader
gloves = /obj/item/clothing/gloves/krav_maga/combatglovesplus
r_hand = /obj/item/nuclear_challenge
command_radio = TRUE
/datum/outfit/syndicate/no_crystals
tc = 0
/datum/outfit/syndicate/post_equip(mob/living/carbon/human/H)
var/obj/item/radio/R = H.ears
R.set_frequency(FREQ_SYNDICATE)
R.freqlock = TRUE
if(command_radio)
R.command = TRUE
if(tc)
var/obj/item/U = new uplink_type(H, H.key, tc)
H.equip_to_slot_or_del(U, SLOT_IN_BACKPACK)
var/obj/item/implant/weapons_auth/W = new/obj/item/implant/weapons_auth(H)
W.implant(H)
var/obj/item/implant/explosive/E = new/obj/item/implant/explosive(H)
E.implant(H)
H.faction |= ROLE_SYNDICATE
H.update_icons()
/datum/outfit/syndicate/full
name = "Syndicate Operative - Full Kit"
glasses = /obj/item/clothing/glasses/night
mask = /obj/item/clothing/mask/gas/syndicate
suit = /obj/item/clothing/suit/space/hardsuit/syndi
r_pocket = /obj/item/tank/internals/emergency_oxygen/engi
internals_slot = SLOT_R_STORE
belt = /obj/item/storage/belt/military
r_hand = /obj/item/gun/ballistic/shotgun/bulldog
backpack_contents = list(/obj/item/storage/box/syndie=1,\
/obj/item/tank/jetpack/oxygen/harness=1,\
/obj/item/gun/ballistic/automatic/pistol=1,\
/obj/item/kitchen/knife/combat/survival)