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

Сбойные дроны на станции #13459

Closed
wants to merge 10 commits into from
Closed
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
2 changes: 2 additions & 0 deletions code/__DEFINES/gamemodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define F_XENOMORPH_HIVE "Alien Hivemind"
#define F_ZOMBIES "Zobmies"
#define F_REPLICATORS "Replicators"
#define F_MALF_DRONES "Malf Drones"

// Role IDs
#define ABDUCTOR_AGENT "Abductor Agent"
Expand Down Expand Up @@ -67,6 +68,7 @@
#define REPLICATOR "Replicator"
#define PIRATE "Pirate"
#define PRISONER "Prisoner"
#define MALF_DRONE "Malf Drone"

////////////////////// GREETS /////////////////////////
#define GREET_DEFAULT "default"
Expand Down
4 changes: 4 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ var/global/gametime_offset = 12 HOURS //Deciseconds to add to world.time for sta
var/global/playsound_frequency_admin = 0 // Admin var for shitspawn via Secrets panel

var/global/nuclear_siren_cooldown = 0

var/global/disposal_count = 0
var/global/parquet_installed_count = 0
var/global/chairs_count = 0
Tap0r marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions code/datums/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ var/global/const/base_law_type = /datum/ai_laws/crewsimov
add_inherent_law("Не причиняй вреда станции и чему-либо на ней.")
add_inherent_law("Не взаимодействуй с кем-либо, кроме дронов.")

/datum/ai_laws/drone/malfuction/New(datum/religion/R = global.chaplain_religion)
add_inherent_law("Станция - наша святыня и дом. Дроны не должны причинять ей вред и нарушать её герметичность.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне честно не оч нравки как сформулированы эти законы но ладно

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне честно не оч нравки как сформулированы эти законы но ладно

  1. не разгермить
  2. самосохранение и помощь друг-другу
  3. выполнение поставленной задачи

add_inherent_law("Мы - верные сыны станции. Дроны должны жить и помогать друг-другу.")
add_inherent_law("Станция доверила нам задачу. Дроны должны помочь станции преобразиться.")

/* Religious */
/datum/ai_laws/faith/commandments/New(datum/religion/R = global.chaplain_religion)
add_inherent_law("[pick(R.deity_names)] ваш Господь Бог, да не будет у тебя других богов. Священник и [pick(R.deity_names)] - ваши хозяева.")
Expand Down
29 changes: 29 additions & 0 deletions code/datums/spawners_menu/spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -746,3 +746,32 @@
var/datum/role/wizard/R = SSticker.mode.CreateRole(/datum/role/wizard, H)
R.rename = FALSE
setup_role(R, TRUE)

/datum/spawner/malf_drone
name = "Сбойный Дрон"
desc = "Станция взывает к вам, ей необходимо преображение."

ranks = list(ROLE_GHOSTLY)

var/obj/machinery/drone_fabricator/fabricator

/datum/spawner/malf_drone/New(obj/machinery/drone_fabricator/DF)
. = ..()
fabricator = DF
RegisterSignal(fabricator, COMSIG_PARENT_QDELETING, PROC_REF(fabricator_deleting))

/datum/spawner/malf_drone/proc/fabricator_deleting()
qdel(src)

/datum/spawner/malf_drone/jump(mob/dead/spectator)
spectator.forceMove(get_turf(fabricator))

/datum/spawner/malf_drone/spawn_body(mob/dead/spectator)
var/client/C = spectator.client

var/mob/living/silicon/robot/drone/maintenance/malfuction/D = new
D.key = C.key
D.forceMove(get_turf(fabricator))

var/datum/faction/malf_drones/F = find_faction_by_type(/datum/faction/malf_drones)
add_faction_member(F, D, TRUE, TRUE)
6 changes: 6 additions & 0 deletions code/game/area/station_areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ADD_TO_GLOBAL_LIST(/area/station, the_station_areas)

/area/station/engineering
icon_state = "engine"
cases = list("инженерный отдел", "инженерного отдела", "инженерному отделу", "инженерный отдел", "инженерным отделом", "инженерном отделе")
looped_ambience = 'sound/ambience/loop_engine.ogg'
sound_environment = SOUND_AREA_STATION_HALLWAY

Expand Down Expand Up @@ -199,6 +200,9 @@ ADD_TO_GLOBAL_LIST(/area/station, the_station_areas)
/area/station/hallway
sound_environment = SOUND_AREA_STATION_HALLWAY

/area/station/hallway/primary
cases = list("главные коридоры", " главных коридоров", "главным коридорам", "главные коридоры", "главными коридорами", "главных коридорах")

/area/station/hallway/primary/fore
name = "Fore Primary Hallway"
cases = list("северный коридор", "северного коридора", "северному коридору", "северный коридор", "северным коридором", "северном коридоре")
Expand Down Expand Up @@ -633,6 +637,8 @@ ADD_TO_GLOBAL_LIST(/area/station, the_station_areas)
icon_state = "exam_room"

//Security
/area/station/security
cases = list("отдел службы безопасности", "отдела службы безопасности", "отделу службы безопасности", "отдел службы безопасности", "отделом службы безопасности", "отделе службы безопасности")

/area/station/security/main
name = "Security Office"
Expand Down
18 changes: 18 additions & 0 deletions code/game/gamemodes/factions/malf_drones.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/datum/faction/malf_drones
name = F_MALF_DRONES
ID = F_MALF_DRONES
logo_state = "malf-logo"
initroletype = /datum/role/malf_drone
max_roles = 6

/datum/faction/malf_drones/forgeObjectives()
if(!..())
return FALSE
AppendObjective(pick(
/datum/objective/malf_drone/closets,
/datum/objective/malf_drone/disposal,
/datum/objective/malf_drone/parquet,
/datum/objective/malf_drone/chairs,
/datum/objective/malf_drone/department/table,
/datum/objective/malf_drone/department/airlock))
return TRUE
106 changes: 106 additions & 0 deletions code/game/gamemodes/objectives/malf_drones.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/datum/objective/malf_drone
explanation_text = ""
var/objective = ""

/datum/objective/malf_drone/New()
explanation_text = pick(
"Станция жаждет преображения.",
"Станция взывает к вам.",
"Станция призвала вас к себе.")
explanation_text += " " + objective
..()

// 1
/datum/objective/malf_drone/closets
objective = "Заварите все шкафы на станции."

/datum/objective/malf_drone/closets/check_completion()
var/counter = 0
for(var/obj/structure/closet/C in global.closet_list)
if(C.welded && is_station_level(C.z))
counter++
if(counter > (closet_list.len / 2))
Tap0r marked this conversation as resolved.
Show resolved Hide resolved
return OBJECTIVE_WIN
return OBJECTIVE_LOSS

// 2
/datum/objective/malf_drone/disposal
objective = "Разберите все мусорки на станции."

/datum/objective/malf_drone/disposal/check_completion()
if(global.disposal_count < 30) // roundstart ~70 on station + 6 on centcom
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему не сделать счетчик как с шкафами вместо хардкода

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

так э шкафы завариваются, а не разбираются полностью

return OBJECTIVE_WIN
return OBJECTIVE_LOSS

// 3
/datum/objective/malf_drone/parquet
objective = "Замените всю плитку на станции паркетом."

/datum/objective/malf_drone/parquet/check_completion()
if(global.parquet_installed_count > 1200) // 300 wood plank
return OBJECTIVE_WIN // roundstart ~6000 floor tiles on station
return OBJECTIVE_LOSS

// 4
/datum/objective/malf_drone/chairs
objective = "Разберите все стулья на станции."

/datum/objective/malf_drone/chairs/check_completion()
if(global.chairs_count < 50) // ¯\_(ツ)_/¯
return OBJECTIVE_WIN // roundstart ???? on station
return OBJECTIVE_LOSS

// 5
/datum/objective/malf_drone/department
var/area/station/target_area
var/list/possible_area = list(
/area/station/medical,
/area/station/rnd,
/area/station/bridge,
/area/station/engineering,
/area/station/security,
/area/station/cargo)

/datum/objective/malf_drone/department/table
objective = "Полностью заполните отдел столами."

/datum/objective/malf_drone/department/table/New()
possible_area += /area/station/hallway
target_area = pick(possible_area)
objective = "Полностью заполните [CASE(target_area, ACCUSATIVE_CASE)] столами."
..()

/datum/objective/malf_drone/department/table/check_completion()
var/counter = 0
var/turf_amount = 0

for(var/area/A in typesof(target_area))
for(var/obj/structure/table/T in get_area_by_type(target_area))
counter++
for(var/turf/simulated/floor/F in get_area_by_type(target_area))
turf_amount++

if(counter > turf_amount / 1.5)
Tap0r marked this conversation as resolved.
Show resolved Hide resolved
return OBJECTIVE_WIN
return OBJECTIVE_LOSS

// 6
/datum/objective/malf_drone/department/airlock
objective = "Полностью разберите все внутренние шлюзы отдела."

/datum/objective/malf_drone/department/airlock/New()
target_area = pick(possible_area)
objective = "Разберите все внутренние шлюзы [CASE(target_area, GENITIVE_CASE)]."
..()

/datum/objective/malf_drone/department/airlock/check_completion()
var/counter = 0

for(var/A in typesof(target_area))
for(var/obj/machinery/door/airlock/D in get_area_by_type(A))
if(!istype(D, /obj/machinery/door/airlock/external))
counter++

if(counter < 8)
return OBJECTIVE_WIN
return OBJECTIVE_LOSS
19 changes: 19 additions & 0 deletions code/game/gamemodes/roles/malf_drone.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/datum/role/malf_drone
name = MALF_DRONE
id = MALF_DRONE

antag_hud_type = ANTAG_HUD_MALF
antag_hud_name = "hudmalai"

logo_state = "malf-logo"

/datum/role/malf_drone/Greet(greeting, custom)
. = ..()
antag.current.playsound_local(null, 'sound/antag/malf.ogg', VOL_EFFECTS_MASTER, null, FALSE)
to_chat(antag.current, {"<span class='notice'><b>Вы - сбойный дрон.
У вас есть общая великая цель по преображению станции. Вы должны выполнить её во чтобы то ни стало.
Действуйте сообща с другими дронами. Ремонтируйте друг-друга в случае необходимости.
Вы можете нападать на людей, но только если они мешают вам выполнить вашу цель.
Не жертвуйте собой, если видите у человека оружие, лучше отступите и уйдите в другое место.
ПО ПЕРВОМУ ЗАКОНУ ВЫ НЕ МОЖЕТЕ ВРЕДИТЬ СТАНЦИИ И НАРУШАТЬ ЕЁ ГЕРМЕТИЧНОСТЬ. НИКАКИХ ДЫР В КОСМОС.
------------------</b></span>"})
3 changes: 3 additions & 0 deletions code/game/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@
/mob/living/silicon/robot/drone/syndi/GetAccess()
return list(access_maint_tunnels, access_syndicate, access_external_airlocks) //syndicate basic access

/mob/living/silicon/robot/drone/maintenance/malfuction/GetAccess()
return list(access_maint_tunnels)

/obj/item/proc/GetID()
return null

Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/structures/stool_bed_chair_nest/chairs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@

/obj/structure/stool/bed/chair/atom_init()
..()
if(is_station_level(z))
global.chairs_count++
return INITIALIZE_HINT_LATELOAD

/obj/structure/stool/bed/chair/atom_init_late()
handle_rotation()

/obj/structure/stool/bed/chair/Destroy()
if(is_station_level(z))
global.chairs_count--
return ..()

/obj/structure/stool/bed/chair/Move(NewLoc, Dir = 0, step_x = 0, step_y = 0)
. = ..()

Expand Down
7 changes: 6 additions & 1 deletion code/game/turfs/simulated/floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,19 @@ var/global/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","dama
if(istype(get_step(src,direction),/turf/simulated/floor))
var/turf/simulated/floor/FF = get_step(src,direction)
FF.update_icon() //so siding gets updated properly
if(istype(T,/obj/item/stack/tile/wood))
global.parquet_installed_count++
update_icon()
levelupdate()

//Proc for make turf into plating
//Proc for make turf into plating
/turf/simulated/floor/proc/remove_floor(obj/item/C, mob/user)
if(broken || burnt)
to_chat(user, "<span class='warning'>Вы сняли поврежденное покрытие.</span>")
else
if(is_wood_floor())
to_chat(user, "<span class='warning'>Вы с трудом отодрали доски, сломав их.</span>")
global.parquet_installed_count--
else
var/obj/item/I = new floor_type(src)
if(is_light_floor())
Expand All @@ -480,6 +483,7 @@ var/global/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","dama
broken = 0
burnt = 0
underfloor_accessibility = UNDERFLOOR_HIDDEN
global.parquet_installed_count++
if(T)
if(istype(T,/obj/item/stack/tile/wood))
floor_type = T.type
Expand Down Expand Up @@ -531,6 +535,7 @@ var/global/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","dama
if(is_wood_floor())
to_chat(user, "<span class='warning'>Вы открутили доски.</span>")
new floor_type(src)
global.parquet_installed_count--

make_plating()
playsound(src, 'sound/items/Screwdriver.ogg', VOL_EFFECTS_MASTER)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/events/ion_storm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
if(prob(botEmagChance))
bot.emag_act()

var/list/fabricators = list()
for(var/obj/machinery/drone_fabricator/DF in machines)
if(!DF.emagged)
fabricators += DF
if(fabricators.len)
var/obj/machinery/drone_fabricator/DF = pick(fabricators)
DF.malfunction()

/mob/living/silicon/ai/proc/overload_ai_system()
var/ion_law = generate_ion_law()
to_chat(src, "<b>&@&%**ВНИМА^$E. ПЕРЕГРУЗКА СИСТЕМ ИИ.</b>")
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@
icon_state = "drone"
flags = HEAR_PASS_SAY

/obj/item/weapon/holder/malf_drone
name = "strange drone"
desc = "Крайне странный дрон. В его мозгу поплавилась не одна микросхема."
icon_state = "drone"
origin_tech = "magnets=3;engineering=5"
flags = HEAR_PASS_SAY

/obj/item/weapon/holder/cat
name = "cat"
desc = "It's a cat. Meow."
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/silicon/robot/drone/drone_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@

var/mob/living/silicon/robot/drone/D = locate(href_list["shutdown"])

if(D.stat != DEAD)
if(D.emagged || istype(D, /mob/living/silicon/robot/drone/maintenance/malfuction))
to_chat(usr, "<span class='notice'>Система самоуничтожения этого дрона неисправна.</span>")
else if(D.stat != DEAD)
to_chat(usr, "<span class='warning'>You issue a kill command for the unfortunate drone.</span>")
message_admins("[key_name_admin(usr)] issued kill order for drone [key_name_admin(D)] from control console. [ADMIN_JMP(usr)]")
log_game("[key_name(usr)] issued kill order for [key_name(src)] from control console.")
Expand Down
13 changes: 13 additions & 0 deletions code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
new /obj/item/stack/sheet/metal(loc, 5)
..()

/obj/machinery/drone_fabricator/emag_act(mob/user)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
Tap0r marked this conversation as resolved.
Show resolved Hide resolved
s.set_up(5, 1, src)
s.start()
return malfunction()

/obj/machinery/drone_fabricator/proc/malfunction()
if(emagged) return FALSE
emagged = TRUE
create_uniq_faction(/datum/faction/malf_drones)
create_spawners(/datum/spawner/malf_drone, 3, src)
return TRUE

/mob/proc/dronize()

for(var/obj/machinery/drone_fabricator/DF in machines)
Expand Down
Loading
Loading