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 9 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
1 change: 1 addition & 0 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ 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/air_alarms = list()
var/global/list/table_list = list() // obj/structure/table

var/global/list/spells_by_aspects = list()
var/global/list/rites_by_aspects = list()
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
32 changes: 32 additions & 0 deletions code/datums/spawners_menu/spawners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -746,3 +746,35 @@
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))

D.mind.skills.add_available_skillset(/datum/skillset/cyborg)
D.mind.skills.maximize_active_skills()

var/datum/faction/malf_drones/F = find_faction_by_type(/datum/faction/malf_drones)
add_faction_member(F, D, FALSE)
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
108 changes: 108 additions & 0 deletions code/game/gamemodes/objectives/malf_drones.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/datum/objective/malf_drone
explanation_text = ""
var/objective = ""

/datum/objective/malf_drone/New()
explanation_text = "Внемли же словам моим, дрон. "
explanation_text += objective
..()

// 1
/datum/objective/malf_drone/closets
objective = "Лязг стальных дверей мне наскучил. Заварите все шкафы на станции."

/datum/objective/malf_drone/closets/check_completion()
var/welded_closets = 0
var/all_closets = 0

for(var/obj/structure/closet/C in global.closet_list)
if(is_station_level(C.z))
all_closets++
if(C.welded)
welded_closets++

if(welded_closets > all_closets * 0.7)
return OBJECTIVE_WIN
return OBJECTIVE_LOSS

// 2
/datum/objective/malf_drone/disposal
objective = "Вечный шум гремящего в трубах мусора утомляет меня. Разберите все мусорки на станции."

/datum/objective/malf_drone/disposal/check_completion()
if(global.disposal_count < 20) // roundstart ~70 on station
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/primary
possible_area[/area/station/hallway/primary] = "главные коридоры"
target_area = pick(possible_area)
objective += "Полностью заполните [possible_area[target_area]] столами."
..()

/datum/objective/malf_drone/department/table/check_completion()
var/tables = 0
var/list/areas = typesof(target_area)

for(var/obj/O as anything in global.table_list)
if(get_area(O) in areas)
tables++

if(tables > 180) // 30/60 tables for each drone in faction
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 += "Освободите [possible_area[target_area]] от шлюзов."
..()

/datum/objective/malf_drone/department/airlock/check_completion()
var/airlocks = 0
var/list/areas = typesof(target_area)

for(var/obj/O in global.airlock_list)
if(get_area(O) in areas)
if(!istype(O, /obj/machinery/door/airlock/external))
airlocks++

if(airlocks < 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
3 changes: 2 additions & 1 deletion code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
update_adjacent()

AddComponent(/datum/component/clickplace)
global.table_list += src

/obj/structure/table/Destroy()
global.table_list -= src
if(flipped)
update_adjacent()
return ..()
Expand Down Expand Up @@ -734,7 +736,6 @@
/*
* reinforced glass table
*/

/obj/structure/table/rglass
name = "reinforced glass table"
desc = "A reinforced version of the glass table"
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.emag_act()

/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
Loading
Loading