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

играюсь с ботом юнит теста #3073

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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: 1 addition & 1 deletion mods/anomaly/_anomaly.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/singleton/modpack/colony_types
name = "Интерактивные аномалии"
desc = "Добавляет в игру полноценные аномалии, вдохновлённые Ашаном, пикником на обочине и сталкером."
author = "Shegar"
author = "Shegar(Код), HonkByEmo(Спрайты), AK200(Спрайты)"
30 changes: 15 additions & 15 deletions mods/anomaly/_anomaly.dme
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@
#include "code\artefacts\artefact_flyer.dm"
//#include "code\artefacts\artefact_zjemchug.dm"


//Код больших артефактов
#include "code\big_artefacts\_core.dm"
#include "code\big_artefacts\gravi_concetration.dm"
#include "code\big_artefacts\electra_gem.dm"
#include "code\big_artefacts\fire_ball.dm"

//Детекторы и прочее оборудование
#include "code\detectors_and_etc\bolt.dm"
Expand All @@ -66,22 +70,17 @@
#include "code\detectors_and_etc\deployer.dm"
#include "code\detectors_and_etc\beacon.dm"
#include "code\detectors_and_etc\research_machine.dm"



//Погода и эффекты на мониторе
#include "code\monitor_effects\monitor_core.dm"
#include "code\monitor_effects\monitor_vars.dm"
#include "code\monitor_effects\snow_monitor_effect.dm"
#include "code\monitor_effects\swamp_monitor_effect.dm"
#include "code\monitor_effects\vulcan_monitor_effect.dm"
#include "code\detectors_and_etc\artefact_detector.dm"
#include "code\detectors_and_etc\rig_detector.dm"
#include "code\detectors_and_etc\flux_detector.dm"


//Размещение аномалий в игре
#include "code\spawn_anomalies_protocol\core_spawn_protocol.dm"
#include "code\spawn_anomalies_protocol\spawn_anomaly_with_big_artefact.dm" //Код, отвечающий за спавн аномалий вокруг больших артефактов
#include "code\spawn_anomalies_protocol\spawn_with_ruins.dm"
#include "code\spawn_anomalies_protocol\bsd_event_protocol.dm"
#include "code\spawn_anomalies_protocol\planet_big_artefacts.dm"
//Планетарный спавн
#include "code\spawn_anomalies_protocol\planet_spawn_protocol\_planet_spawn_core.dm"
//Летающие острова[WIP]
Expand All @@ -90,16 +89,17 @@
//Ледяная планета[WIP]
#include "code\spawn_anomalies_protocol\planet_spawn_protocol\ice.dm"
//Вулкан
#include "code\spawn_anomalies_protocol\planet_spawn_protocol\vulcanic.dm"
//Саргасово болото [WIP-WIP]
// #include "code\spawn_anomalies_protocol\planet_spawn_protocol\sargas.dm"
#include "code\spawn_anomalies_protocol\spawn_on_planet.dm" //Спавн на планетах


#include "code\spawn_anomalies_protocol\planet_spawn_protocol\another_planets.dm"

//Карты, диреликты и прочее
#include "maps\electra_ruins\electra_ruins.dm"
#include "maps\zharka_ruins\zharka_ruins.dm"
//#include "maps\electra_ruins\electra_ruins.dm"
//#include "maps\zharka_ruins\zharka_ruins.dm"
//#include "maps\electra_ruins\garage.dm"
//#include "maps\electra_ruins\bunker.dm"
//#include "maps\electra_ruins\deployed_generator.dm"
//Код островов
#include "maps\flying_islands\flying_island.dm"
#include "maps\flying_islands\flying_island_ball.dm"
Expand Down
10 changes: 7 additions & 3 deletions mods/anomaly/code/anomalies/single/electra.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
anomaly.activate_anomaly(FALSE)

/obj/anomaly/electra/get_effect_by_anomaly(atom/movable/target)
set waitfor = FALSE
//Понадобится нам, если обьект по какой-либо причине будет удалён из-за удара, дабы "лучу" было куда идти
var/target_turf = get_turf(target)
if(!isturf(target.loc))
Expand All @@ -87,7 +88,10 @@
return
//Если цель подходит под критерии удара, мы рисуем молнию
var/create_line = FALSE

if(isaurora(target))
var/obj/structure/aurora/aurora = target
aurora.wake_up(rand(5 SECONDS, 10 SECONDS))
create_line = TRUE



Expand Down Expand Up @@ -128,7 +132,7 @@
var/mob/living/carbon/human/victim = target
if(victim.health == 0)
SSanom.add_last_gibbed(target, "Электра")
anything_in_remains(victim)
victim.dust()
return

if(victim.lying) //Если цель лежит нам не нужно просчитывать путь до земли. Просто делаем удар в любую конечность
Expand Down Expand Up @@ -158,7 +162,7 @@
create_line = TRUE
var/mob/living/victim = target
if(victim.health == 0)
anything_in_remains(victim)
victim.dust()
return
victim.electoanomaly_act(100, src)

Expand Down
3 changes: 2 additions & 1 deletion mods/anomaly/code/anomaly_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ PROCESSING_SUBSYSTEM_DEF(anom)
var/interactions_with_artefacts_by_players_ammount = 0
var/bad_interactions_with_artefacts_by_players_ammount = 0
var/good_interactions_with_artefacts_by_players_ammount = 0

//Большие артефакты
var/list/big_anomaly_artefacts = list()


//[ИНФА ПО АНОМАЛИЯМ]
Expand Down
2 changes: 2 additions & 0 deletions mods/anomaly/code/artefacts/_anomaly_artefacts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
if(AnomaliesAmmountInTurf(get_turf(src)) == 0)
connected_to_anomaly = FALSE
input_collector.try_insert_artefact(user, src)
SSanom.collected_artefacts_by_player++
else
for(var/obj/anomaly/anomka in src.loc.contents)
if(prob(25 * user.get_skill_value(SKILL_SCIENCE)))
to_chat(user, SPAN_GOOD("Вы аккуратно, при помощи специальных щупов, помещаете обьект в контейнер."))
connected_to_anomaly = FALSE
SSanom.collected_artefacts_by_player++
input_collector.try_insert_artefact(user, src)
else
to_chat(user, SPAN_WARNING("Обьект уплывает из хвата щупов"))
Expand Down
66 changes: 66 additions & 0 deletions mods/anomaly/code/big_artefacts/_core.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/obj/structure/big_artefact
name = "Something"
desc = "A large something."
icon = 'mods/anomaly/icons/big_artefacts.dmi'
density = TRUE
waterproof = FALSE
var/min_anomalies_ammout = 100
var/max_anomalies_ammout = 200
var/min_artefacts_ammount = 1
var/max_artefacts_ammount = 2
var/range_spawn = 30
var/list/possible_anomalies = list()

/obj/structure/big_artefact/Initialize()
. = ..()
born_anomalies()

///Функция, которая заспавнит вокруг большого артефакта аномалии
/obj/structure/big_artefact/proc/born_anomalies()
set background = 1
var/started_in = world.time
var/list/turfs_for_spawn = list()
//У нас нет турфа?
if(!src.loc)
return
//Собираем все турфы в определённом радиусе
for(var/turf/turfs in RANGE_TURFS(src.loc, range_spawn))
if(!TurfBlocked(turfs) || TurfBlockedByAnomaly(turfs))
LAZYADD(turfs_for_spawn, turfs)
generate_anomalies_in_turfs(possible_anomalies, turfs_for_spawn, min_anomalies_ammout, max_anomalies_ammout, min_artefacts_ammount, max_artefacts_ammount, null, null, "big artefact generation", started_in)

/obj/structure/big_artefact/shuttle_land_on()
delete_artefact()

/obj/structure/big_artefact/proc/delete_artefact()
LAZYREMOVE(SSanom.big_anomaly_artefacts, src)
qdel(src)

/obj/structure/big_artefact/MouseDrop(obj/machinery/anomaly_container/over_object, mob/user)
if(istype(over_object) && CanMouseDrop(over_object, usr))
if (over_object.health_dead())
visible_message(SPAN_WARNING("\The [over_object]'s containment is broken shut."))
return
if (!over_object.allowed(usr))
visible_message(SPAN_WARNING("\The [over_object] blinks red, refusing to open."))
return
user.visible_message(
SPAN_NOTICE("\The [usr] begins placing \the [src] into \the [over_object]."),
SPAN_NOTICE("You begin placing \the [src] into \the [over_object].")
)
if(!do_after(usr, 4 SECONDS, over_object, DO_PUBLIC_UNIQUE))
return
user.visible_message(SPAN_NOTICE("The bolts on \the [over_object] drop with an hydraulic hiss, sealing its contents."))
playsound(loc, 'sound/mecha/hydraulic.ogg', 40)
Bumped(usr)
over_object.contain(src)
return

/obj/structure/big_artefact/forceMove()
..()
if(is_processing)
if(get_turf(src) != loc)
STOP_PROCESSING(SSanom, src)
else
if(get_turf(src) == loc)
START_PROCESSING(SSanom, src)
40 changes: 40 additions & 0 deletions mods/anomaly/code/big_artefacts/electra_gem.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/obj/structure/big_artefact/electra
icon_state = "electra_anomalies"
min_anomalies_ammout = 70
max_anomalies_ammout = 150
range_spawn = 30
possible_anomalies = list(
/obj/anomaly/electra/three_and_three = 1,
/obj/anomaly/electra/three_and_three/tesla = 2,
/obj/anomaly/electra/three_and_three/tesla_second = 3,
/obj/anomaly/cooler/two_and_two = 1,
/obj/anomaly/cooler/three_and_three = 1
)
//
var/datum/beam = null
var/last_electra_attack
var/electra_attack_cooldown

/obj/structure/big_artefact/electra/Initialize()
.=..()
if(!is_processing)
START_PROCESSING(SSanom, src)
electra_attack_cooldown = rand(20 SECONDS, 50 SECONDS)
last_electra_attack = world.time

//Пусть кусается молниями в пределах 3 турфов.
/obj/structure/big_artefact/electra/Process()
if(world.time - last_electra_attack > electra_attack_cooldown)
electra_attack()

/obj/structure/big_artefact/electra/proc/electra_attack()
set waitfor = FALSE
last_electra_attack = world.time
var/turf/picked_turf
picked_turf = pick(RANGE_TURFS(src, 3))
for(var/mob/living/picked_living in picked_turf)
picked_living.electoanomaly_act(50, src)
for(var/obj/structure/aurora/picked_aurora in picked_turf)
picked_aurora.wake_up(5 SECONDS)
beam = src.Beam(BeamTarget = picked_turf, icon_state = "electra_long",icon='mods/anomaly/icons/effects.dmi',time = 0.3 SECONDS)
playsound(src, 'mods/anomaly/sounds/electra_blast.ogg', 100, FALSE )
9 changes: 9 additions & 0 deletions mods/anomaly/code/big_artefacts/fire_ball.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/obj/structure/big_artefact/hot
icon_state = "hot_anomalies"
min_anomalies_ammout = 100
max_anomalies_ammout = 200
range_spawn = 30
possible_anomalies = list(
/obj/anomaly/zharka/short_effect = 1,
/obj/anomaly/zharka/long_effect = 2,
)
32 changes: 32 additions & 0 deletions mods/anomaly/code/big_artefacts/gravi_concetration.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/obj/structure/big_artefact/gravi
icon_state = "gravi_anomalies"
min_anomalies_ammout = 60
max_anomalies_ammout = 120
range_spawn = 30
possible_anomalies = list(
/obj/anomaly/thamplin/random = 2,
/obj/anomaly/rvach/three_and_three = 1
)
var/last_gravi_attack
var/gravi_attack_cooldown

/obj/structure/big_artefact/gravi/Initialize()
.=..()
if(!is_processing)
START_PROCESSING(SSanom, src)
gravi_attack_cooldown = rand(20 SECONDS, 50 SECONDS)
last_gravi_attack = world.time

/obj/structure/big_artefact/gravi/Process()
if(world.time -last_gravi_attack > gravi_attack_cooldown)
gravi_attack()

/obj/structure/big_artefact/gravi/proc/gravi_attack()
set waitfor = FALSE
last_gravi_attack = world.time
for(var/turf/picked_turf in RANGE_TURFS(src, 5))
for(var/mob/living/picked_living in picked_turf)
picked_living.Weaken(3)
picked_living.stun_effect_act(3,1)
to_chat(picked_living, SPAN_WARNING("Что-то с силой прижимает вас к земле."))
shake_camera(picked_living, 3, 1)
89 changes: 89 additions & 0 deletions mods/anomaly/code/detectors_and_etc/artefact_detector.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/obj/item/artefact_detector
name = "artefact detector"
desc = "Newest advanced device, which can find artefacts."
icon = 'mods/anomaly/icons/artefact_detector.dmi'
icon_state = "medv_turned_off"
item_state = "on_floor_off"
//on_turf_icon = 'mods/anomaly/icons/artefact_detector_on_floor.dmi'
var/capturing_method = "RANDOM" //RANDOM - любой на Z уровне. CLOSEST - ближайший на Z уровне. LONGEST - дальнейший на Z уровне.
var/status = FALSE
var/showing_artefact = FALSE //Детектор уже указывает куда-то
var/obj/item/artefact/captured_artefact

/obj/item/artefact_detector/examine(mob/user, distance, is_adjacent)
. = ..()
to_chat(user, SPAN_GOOD("Используйте КНТРЛ + ЛКМ для включения/выключения детектора."))

//Переключения//
/obj/item/artefact_detector/AltClick()
if(!status)
turn_on()
else
turn_off()
return

/obj/item/artefact_detector/proc/turn_on()
to_chat(usr, SPAN_NOTICE("Вы включили детектор"))
flick("medv_turning_on", src)
status = TRUE
icon_state = "medv_turned_on"
item_state = "on_floor_on"

/obj/item/artefact_detector/proc/turn_off()
to_chat(usr, SPAN_NOTICE("Вы выключили детектор"))
flick("medv_turning_off", src)
if(status)
forgive_artefact()
status = FALSE
icon_state = "medv_turned_off"
item_state = "on_floor_off"

/obj/item/artefact_detector/attack_self(mob/living/user)
. = ..()
if(status)
find_and_capture_artefact_in_Z()
//Начинаем захват артефакта
else
to_chat(usr, SPAN_NOTICE("Детектор выключен."))

//Процессинг//
/obj/item/artefact_detector/Process()
var/dir = get_dir(get_turf(src), get_turf(captured_artefact))
if(!dir)
forgive_artefact()
var/text_dir = dir2text(dir)
icon_state = "medv_[text_dir]"

///Отдельные функции///
/obj/item/artefact_detector/proc/find_and_capture_artefact_in_Z()//Задача - найти артефакт в на Z уровне и запомнить его.
if(!LAZYLEN(SSanom.artefacts_list_in_world)) //Артефактов в мире попросту нет
to_chat(usr, SPAN_NOTICE("Похоже, [src] ничего не улавливает."))
return FALSE

var/list/good_z_artefacts_list = list()
for(var/obj/item/artefact/choosed_artefact in SSanom.artefacts_list_in_world)
if(get_z(src) == get_z(choosed_artefact))
LAZYADD(good_z_artefacts_list,choosed_artefact)

if(!LAZYLEN(good_z_artefacts_list)) //Артефакты то есть в мире, но не на нашем Z уровне
to_chat(usr, SPAN_NOTICE("Похоже, [src] ничего не улавливает."))
return FALSE

if(capturing_method == "RANDOM")
capture_artefact(pick(good_z_artefacts_list))
else if(capturing_method == "CLOSEST")
return
else if(capturing_method == "LONGEST")
return


/obj/item/artefact_detector/proc/capture_artefact(obj/item/artefact/input_artefact) //Функция захватывает и запоминает артефакт.
to_chat(usr, SPAN_NOTICE("Похоже, [src] Что-то улавливает."))
captured_artefact = input_artefact
START_PROCESSING(SSanom, src)

/obj/item/artefact_detector/proc/forgive_artefact() //Функция забывает артефакт
to_chat(usr, SPAN_NOTICE("[src] умолкает."))
captured_artefact = null
STOP_PROCESSING(SSanom, src)
icon_state = "medv_turned_on"
10 changes: 10 additions & 0 deletions mods/anomaly/code/detectors_and_etc/beacon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
for(var/obj/item/storage/bolt_bag/bag in usr)
if(bag.autocollect)
bag.can_be_inserted(src, usr, 0)
src.forceMove(bag)

/obj/item/advanced_bolt/Move()
. = ..()
Expand Down Expand Up @@ -56,3 +57,12 @@
/obj/item/advanced_bolt,
/obj/item/advanced_bolt
)

/datum/design/item/bluespace/beacon
name = "electrostatis beacon"
desc = "Small metal beacon with simple electronic inside which can detect powerfull electrostatic field."
id = "electro_beacon"
req_tech = list(TECH_MATERIAL = 2, TECH_MAGNET = 2, TECH_POWER = 2)
build_path = /obj/item/advanced_bolt
materials = list(MATERIAL_ALUMINIUM = 500, MATERIAL_STEEL = 500, MATERIAL_PLASTIC = 500)
sort_string = "VAWAB"
Loading
Loading