Skip to content

Commit

Permalink
anomaly_detection
Browse files Browse the repository at this point in the history
bam
  • Loading branch information
AmShegars committed Nov 1, 2024
1 parent f7a9ac2 commit e951e3d
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 13 deletions.
9 changes: 0 additions & 9 deletions mods/anomaly/_anomaly.dme
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,3 @@


#endif
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
// END_INCLUDE
4 changes: 3 additions & 1 deletion mods/anomaly/code/anomalies/anomaly_graphic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
///Эффект в идле
var/idle_effect_type = "none"
///Как видят аномалию при обнаружении
var/detection_icon_state = "any_anomaly"
plane = OBSERVER_PLANE
///Здесь вам потребуется вручную указать длинну анимации, для того чтоб игра вновь сделала её невидимой и некликабельной для игрока
//Костыль, но лучше решения ещё не придумал
Expand Down Expand Up @@ -61,3 +60,6 @@
///Убираем свет/вспышку
/obj/anomaly/proc/stop_light()
set_light(0)

/obj/anomaly/proc/get_detection_icon()
return detection_icon_state
4 changes: 4 additions & 0 deletions mods/anomaly/code/anomalies/anomaly_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@
return TRUE

return FALSE

/obj/anomaly/part/get_detection_icon()
if(core)
return core.get_detection_icon()
10 changes: 10 additions & 0 deletions mods/anomaly/code/anomalies/single/electra.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
can_be_preloaded = TRUE
being_preload_chance = 30
detectable_effect_range = TRUE
detection_skill_req = SKILL_EXPERIENCED

/obj/anomaly/electra/activate_anomaly(activate_friends = TRUE)
last_activation_time = world.time//Без этой строчки некоторые электры входят в вечный цикл зарядки и удара, костыль? Возможно
Expand Down Expand Up @@ -263,3 +264,12 @@
else if(attack_zone == BP_R_LEG)
LAZYADD(result_damaged_zones, BP_R_FOOT)
return result_damaged_zones


/obj/anomaly/electra/get_detection_icon()
if(effect_range == 1)
return "electra_detection"
else if(effect_range == 2)
return "tesla_first_detection"
else if(effect_range > 2)
return "tesla_second_detection"
4 changes: 4 additions & 0 deletions mods/anomaly/code/anomalies/single/rvach.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/obj/item/artefact/gravi = 1
)
artefact_spawn_chance = 20
detection_skill_req = SKILL_EXPERIENCED

//Аномалия выполняет своё финальное воздействие на все обьекты что оказались в её центре
/obj/anomaly/rvach/proc/get_end_effect_by_anomaly(target)
Expand Down Expand Up @@ -172,3 +173,6 @@
jumper.Weaken(5)
helper.Weaken(5)
return TRUE

/obj/anomaly/rvach/get_detection_icon()
return "rvach_detection"
4 changes: 4 additions & 0 deletions mods/anomaly/code/anomalies/single/tramplin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
max_coldown_time = 8 SECONDS
being_preload_chance = 10
chance_to_be_detected = 75
detection_skill_req = SKILL_BASIC

/obj/anomaly/tramplin/Initialize()
. = ..()
Expand Down Expand Up @@ -64,3 +65,6 @@
victim.throw_at_random(own_turf, range_of_throw, speed_of_throw )
else
victim.throw_at(target_turf, range_of_throw, speed_of_throw)

/obj/anomaly/tramplin/get_detection_icon()
return "trampline_detection"
3 changes: 3 additions & 0 deletions mods/anomaly/code/anomalies/single/ventilyator.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Не доделано
/proc/random_dir()
return pick(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)
Expand Down Expand Up @@ -26,6 +27,7 @@
time_between_effects = 0.25 SECONDS
being_preload_chance = 10
chance_to_be_detected = 75
detection_skill_req = SKILL_EXPERIENCED
/obj/anomaly/ventilyator/Initialize()
. = ..()
Expand Down Expand Up @@ -57,3 +59,4 @@
for(var/atom/atoms in list_of_effected_turfs)
get_effect_by_anomaly(atoms)
start_processing_long_effect()
*/
1 change: 1 addition & 0 deletions mods/anomaly/code/anomalies/single/vspishka.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
can_be_preloaded = TRUE
being_preload_chance = 80
chance_to_be_detected = 75
detection_skill_req = SKILL_MASTER

/obj/anomaly/vspishka/activate_anomaly()
last_activation_time = world.time
Expand Down
10 changes: 10 additions & 0 deletions mods/anomaly/code/anomalies/single/zjarka.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
artefact_spawn_chance = 10
can_be_preloaded = FALSE
being_preload_chance = 20
detection_skill_req = SKILL_BASIC


/obj/anomaly/zjarka/activate_anomaly()
Expand Down Expand Up @@ -95,3 +96,12 @@
if(can_be_activated(O))
activate_anomaly()
return


/obj/anomaly/zjarka/get_detection_icon()
if(effect_range == 1 || effect_range == 0)
return "zjarka_detection"
else if(effect_range == 2)
return "zjarka_first_detection"
else if(effect_range > 2)
return "zjarka_second_detection"
15 changes: 12 additions & 3 deletions mods/anomaly/code/detectors_and_etc/detector.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/obj/anomaly
///Шанс, что аномалию найдут детектором при условии что у пользователя максимальный навык науки
var/chance_to_be_detected = 100
//Спрайт обнаруженной аномалии. Смотри прок get_detection_icon(). Этот спрайт - стандартный для любых аномок.
var/detection_icon_state = "any_anomaly"
///Уровень навыка в науке, требуемый, чтоб персонаж смог понять тип аномалии
var/detection_skill_req = SKILL_TRAINED


/obj/item/clothing/gloves/anomaly_detector
Expand Down Expand Up @@ -164,14 +168,19 @@
to_chat(user, SPAN_GOOD("Аномалий не обнаружено."))
return FALSE

/proc/show_anomalies(mob/viewer, flick_time, allowed_anomalies)
///Показывает игроку аномалии, которые он обнаружил детектером
/proc/show_anomalies(mob/living/viewer, flick_time, allowed_anomalies)
if(!ismob(viewer) || !viewer.client)
return
var/user_science_lvl = viewer.get_skill_value(SKILL_SCIENCE)
var/list/list_of_showed_anomalies = list()
for(var/obj/anomaly/in_turf_atom in allowed_anomalies)
var/turf/T = get_turf(in_turf_atom)
//var/image/I = image(icon = 'mods/anomaly/icons/detection_icon.dmi',loc = T, icon_state = in_turf_atom.detection_icon_state)
var/image/I = image(icon = 'mods/anomaly/icons/effects.dmi',loc = T, icon_state = "none")
var/image/I
if(user_science_lvl >= in_turf_atom.detection_skill_req)
I = image(icon = 'mods/anomaly/icons/detection_icon.dmi',loc = T, icon_state = in_turf_atom.get_detection_icon())
else
I = image(icon = 'mods/anomaly/icons/detection_icon.dmi',loc = T, icon_state = in_turf_atom.detection_icon_state)
I.layer = EFFECTS_ABOVE_LIGHTING_PLANE
list_of_showed_anomalies += I

Expand Down
Binary file modified mods/anomaly/icons/detection_icon.dmi
Binary file not shown.

0 comments on commit e951e3d

Please sign in to comment.