Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавляет трейторам новую цель на взрыв отсека #12909

Merged
merged 10 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ var/global/list/intercom_list = list()
var/global/list/all_designs = list()
var/global/list/all_supply_pack = list()
var/global/list/all_command_microphones = list()
var/global/list/global_objectives = list() //objectives that need to be completed by several factions or roles

var/global/list/spells_by_aspects = list()
var/global/list/rites_by_aspects = list()
Expand Down
8 changes: 7 additions & 1 deletion code/controllers/subsystem/explosions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ SUBSYSTEM_DEF(explosions)
if(prob(40) && dist < flame_range && !isspaceturf(explode) && !explode.density)
flameturf += explode

for(var/datum/objective/bomb/b in global.global_objectives)
var/area/A = get_area(epicenter)
for(var/area in b.areas_for_objective)
if(istype(A, area) && devastation_range >= 1)
b.already_completed = TRUE
simb11 marked this conversation as resolved.
Show resolved Hide resolved

// Explosion SFX defines...
/// The probability that a quaking explosion will make the station creak per unit. Maths!
#define QUAKE_CREAK_PROB 30
Expand Down Expand Up @@ -455,5 +461,5 @@ SUBSYSTEM_DEF(explosions)
continue
EX_ACT(movable_thing, EXPLODE_LIGHT)
cost_low_mov_atom = MC_AVERAGE(cost_low_mov_atom, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))

currentpart = SSEXPLOSIONS_TURFS
23 changes: 23 additions & 0 deletions code/game/gamemodes/objectives/bomb.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/datum/objective/bomb
explanation_text = "Взорвите выданную вам бомбу в одном из следующих отсеков: Каюта капитана, арсенал, склад токсинов отдела исследований, EVA, телекоммуникации или атмосферный."
simb11 marked this conversation as resolved.
Show resolved Hide resolved
required_equipment = /obj/item/device/radio/beacon/syndicate_bomb/objective
simb11 marked this conversation as resolved.
Show resolved Hide resolved
global_objective = TRUE
var/already_completed = FALSE
var/list/areas_for_objective = list(/area/station/bridge/captain_quarters,
/area/station/security/armoury,
/area/station/rnd/storage,
/area/station/ai_monitored/eva,
/area/station/tcommsat,
/area/station/engineering/atmos)

/datum/objective/bomb/check_completion()
if(!already_completed)
return OBJECTIVE_LOSS
return OBJECTIVE_WIN

/obj/item/device/radio/beacon/syndicate_bomb/objective
bomb_type = /obj/machinery/syndicatebomb/objective
simb11 marked this conversation as resolved.
Show resolved Hide resolved

/obj/machinery/syndicatebomb/objective
min_timer = 120
timer = 120
3 changes: 3 additions & 0 deletions code/game/gamemodes/objectives/objectives.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
var/target_amount = 0 //If they are focused on a particular number. Steal objectives have their own counter.
var/auto_target = TRUE //Whether we pick a target automatically on PostAppend()
var/required_equipment = null
var/global_objective = FALSE

/datum/objective/New(text, _auto_target = TRUE)
if(global_objective)
global_objectives += src
auto_target = _auto_target
if(text)
explanation_text = text
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/objectives/sabotage_research.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/datum/objective/research_sabotage
explanation_text = "Саботируйте сервера Отдела Исследований. Для этого вам выдана специальная дискета, вставьте её в консоль управления серверной ОИ для выполнения задания."
required_equipment = /obj/item/weapon/disk/data/syndi
global_objective = TRUE
var/already_completed = FALSE

/datum/objective/research_sabotage/check_completion()
Expand Down
4 changes: 0 additions & 4 deletions code/game/gamemodes/objectives/steal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_security)
ADD_TO_POIFS_LIST(/obj/item/clothing/under/rank/head_of_personnel)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/hypospray/cmo)
ADD_TO_POIFS_LIST(/obj/item/weapon/pinpointer)
ADD_TO_POIFS_LIST(/obj/item/clothing/suit/armor/laserproof)
ADD_TO_POIFS_LIST(/obj/item/weapon/reagent_containers/spray/extinguisher/golden)
ADD_TO_POIFS_LIST(/obj/item/weapon/gun/energy/gun/nuclear)
ADD_TO_POIFS_LIST(/obj/item/weapon/pickaxe/drill/diamond_drill)
ADD_TO_POIFS_LIST(/obj/item/weapon/storage/backpack/holding)
Expand All @@ -43,8 +41,6 @@ ADD_TO_POIFS_LIST(/obj/item/stack/sheet/mineral/uranium)
"гипоспрей" = /obj/item/weapon/reagent_containers/hypospray/cmo,
"телепортационную броню научрука" = /obj/item/clothing/suit/armor/vest/reactive,
"капитанский целеуказатель" = /obj/item/weapon/pinpointer,
"аблятивная броня" = /obj/item/clothing/suit/armor/laserproof,
"золотой огнетушитель" = /obj/item/weapon/reagent_containers/spray/extinguisher/golden,
)

var/static/possible_items_special[] = list(
Expand Down
4 changes: 3 additions & 1 deletion code/game/gamemodes/roles/traitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
switch(rand(1,120))
if(1 to 20)
AppendObjective(/datum/objective/target/assassinate, TRUE)
if(21 to 30)
if(21 to 25)
AppendObjective(/datum/objective/target/harm, TRUE)
if(26 to 30)
AppendObjective(/datum/objective/bomb, FALSE)
simb11 marked this conversation as resolved.
Show resolved Hide resolved
if(31 to 40)
AppendObjective(/datum/objective/download_telecommunications_data, FALSE)
if(41 to 50)
Expand Down
33 changes: 16 additions & 17 deletions code/game/machinery/syndie_big_bomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
name = "suspicious beacon"
desc = "A label on it reads: <i>Warning: Activating this device will send a high-ordinance explosive to your location</i>."
origin_tech = "bluespace=1;syndicate=7"
var/bomb_type = /obj/machinery/syndicatebomb

/obj/item/device/radio/beacon/syndicate_bomb/attack_self(mob/user)
if(user)
to_chat(user, "<span class='notice'>Locked In</span>")
new /obj/machinery/syndicatebomb( user.loc )
new bomb_type( user.loc )
playsound(src, 'sound/effects/pop.ogg', VOL_EFFECTS_MASTER)
qdel(src)
return
Expand All @@ -24,12 +25,12 @@
use_power = NO_POWER_USE

var/datum/wires/syndicatebomb/wires = null
var/min_timer = 60
var/timer = 60
var/open_panel = FALSE //are the wires exposed?
var/active = FALSE //is the bomb counting down?
var/defused = FALSE //is the bomb capable of exploding?
var/degutted = FALSE //is the bomb even a bomb anymore?

required_skills = list(/datum/skill/engineering = SKILL_LEVEL_PRO)

/obj/machinery/syndicatebomb/proc/try_detonate(ignore_active = FALSE)
Expand Down Expand Up @@ -67,18 +68,20 @@

/obj/machinery/syndicatebomb/examine(mob/user)
..()
to_chat(user, "A digital display on it reads \"[timer]\".")
to_chat(user, "<span class='notice'>A digital display on it reads \"[timer]\".</span>")
simb11 marked this conversation as resolved.
Show resolved Hide resolved

/obj/machinery/syndicatebomb/attackby(obj/item/I, mob/user)
if(iswrenching(I))
if(!anchored)
if(!isturf(src.loc) || isspaceturf(src.loc))
to_chat(user, "<span class='notice'>The bomb must be placed on solid ground to attach it</span>")
else
add_fingerprint(user)
if(!do_skill_checks(user))
return
to_chat(user, "<span class='notice'>You firmly wrench the bomb to the floor</span>")
anchored = TRUE
playsound(src, 'sound/items/Ratchet.ogg', VOL_EFFECTS_MASTER)
if(active)
to_chat(user, "<span class='notice'>The bolts lock in place</span>")
else
Expand All @@ -87,6 +90,7 @@
return
to_chat(user, "<span class='notice'>You wrench the bomb from the floor</span>")
anchored = FALSE
playsound(src, 'sound/items/Ratchet.ogg', VOL_EFFECTS_MASTER)
else
to_chat(user, "<span class='warning'>The bolts are locked down!</span>")

Expand Down Expand Up @@ -135,28 +139,23 @@
return
if(degutted)
to_chat(user, "<span class='notice'>The bomb's explosives have been removed, the [open_panel ? "wires" : "buttons"] are useless now.</span>")
return 1
if(anchored)
if(!active)
settings(user)
else
to_chat(user, "<span class='notice'>The bomb is bolted to the floor!</span>")
return 1
else if(!active)
settings(user)
return TRUE
settings(user)

/obj/machinery/syndicatebomb/proc/settings(mob/user)
var/newtime = input(user, "Please set the timer.", "Timer", "[timer]") as num
newtime = clamp(newtime, 60, 60000)
if(Adjacent(user) && isliving(user) || isobserver(user)) //No running off and setting bombs from across the station
newtime = clamp(newtime, min_timer, 60000)
if(!active && Adjacent(user) && isliving(user) || isobserver(user)) //No running off and setting bombs from across the station
timer = newtime
loc.visible_message("<span class='notice'>[bicon(src)] timer set for [timer] seconds.</span>")
if(tgui_alert(user, "Would you like to start the countdown now?",, list("Yes","No")) == "Yes" && Adjacent(user) && isliving(user))
if(defused || active || degutted)
if(defused || degutted || !anchored)
if(degutted)
loc.visible_message("<span class='notice'>[bicon(src)] Device error: Payload missing</span>")
loc.visible_message("<span class='notice'>[bicon(src)] Device error: Payload missing.</span>")
else if(defused)
loc.visible_message("<span class='notice'>[bicon(src)] Device error: User intervention required</span>")
loc.visible_message("<span class='notice'>[bicon(src)] Device error: User intervention required.</span>")
else if(!anchored)
loc.visible_message("<span class='notice'>[bicon(src)] Device error: Device must be anchored.</span>")
return
else
loc.visible_message("<span class='warning'>[bicon(src)] [timer] seconds until detonation, please clear the area.</span>")
simb11 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
6 changes: 2 additions & 4 deletions code/modules/research/server.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,8 @@
for(var/obj/machinery/computer/rdconsole/c in RDcomputer_list)
if(c.sabotagable)
explosion(c.loc, 0, 1, 3)
var/datum/faction/traitor/faction = find_faction_by_type(/datum/faction/traitor)
for(var/datum/role/traitor/T in faction.members)
for(var/datum/objective/research_sabotage/rs in T.objectives.objectives)
rs.already_completed = TRUE
for(var/datum/objective/research_sabotage/rs in global.global_objectives)
rs.already_completed = TRUE
add_fingerprint(user)
playsound(src, 'sound/machines/ping.ogg', VOL_EFFECTS_MASTER)
to_chat(user, "<span class='nicegreen'>Готово!</span>")
Expand Down
1 change: 1 addition & 0 deletions taucetistation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@
#include "code\game\gamemodes\objectives\absorb.dm"
#include "code\game\gamemodes\objectives\blob_takeover.dm"
#include "code\game\gamemodes\objectives\block.dm"
#include "code\game\gamemodes\objectives\bomb.dm"
#include "code\game\gamemodes\objectives\capture.dm"
#include "code\game\gamemodes\objectives\custom.dm"
#include "code\game\gamemodes\objectives\download.dm"
Expand Down
Loading