diff --git a/baystation12.dme b/baystation12.dme index b52bc3d9d1f2d..337852f8f4554 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -3327,6 +3327,7 @@ #include "maps\_maps.dm" #include "mods\_modpack.dm" #include "mods\global_modpacks.dm" +#include "mods\_master_files\code\_onclick\click.dm" #include "mods\_master_files\code\game\world.dm" #include "mods\_master_files\code\game\gamemodes\ert.dm" #include "mods\_master_files\code\game\objects\effects\decals\contraband.dm" @@ -3365,6 +3366,7 @@ #include "mods\_master_files\code\modules\mob\new_player\new_player.dm" #include "mods\_master_files\code\modules\power\gravitygenerator.dm" #include "mods\_master_files\code\modules\projectiles\projectile\bullets.dm" +#include "mods\_master_files\code\modules\species\station\adherent.dm" #include "mods\_master_files\maps\mapsystem\maps.dm" #include "mods\_master_files\maps\sierra\sierra_ranks.dm" #include "mods\_master_files\maps\sierra\items\rigs.dm" diff --git a/mods/_master_files/code/_onclick/click.dm b/mods/_master_files/code/_onclick/click.dm new file mode 100644 index 0000000000000..c5af19d1cfaa4 --- /dev/null +++ b/mods/_master_files/code/_onclick/click.dm @@ -0,0 +1,55 @@ +/mob/living/carbon/human/AltClickOn(atom/A) + if(get_dist(src, A) > 1) + return ..() + if(!stat && mind && ismob(A) && (A != src) && (src.species.name == SPECIES_ADHERENT)) + var/mob/living/carbon/human/adherent = src + var/obj/item/organ/internal/cell/adherent/adherent_core = adherent.internal_organs_by_name[BP_CELL] + if(adherent_core.ready_to_charge) + var/mob/living/carbon/human/target_human = A + var/mob/living/target = A + var/obj/item/cell/target_cell + var/obj/item/cell/adherent_cell + var/obj/item/organ/internal/cell/acell = locate() in adherent.internal_organs + if(acell && acell.cell) + adherent_cell = acell.cell + + if(adherent_cell && adherent_cell.charge <= 2000) + to_chat(src, SPAN_WARNING("Your cell charge is too low for this action.")) + return + + if(ishuman(target_human)) + var/obj/item/organ/internal/cell/cell = locate() in target_human.internal_organs + if(cell && cell.cell) + target_cell = cell.cell + else if(isrobot(target)) + var/mob/living/silicon/robot/robot = target + target_cell = robot.get_cell() + + target.visible_message(SPAN_WARNING("There is a loud crack and the smell of ozone as \the [adherent] touches \the [target].")) + playsound(loc, 'sound/effects/snap.ogg', 50, 1) + + if(target_cell) + if(target_cell.maxcharge > (target_cell.charge + 2000)) + target_cell.charge += 2000 + else + target_cell.charge = target_cell.maxcharge + to_chat(target, SPAN_NOTICE("Your [target_cell] has been charged.")) + adherent_cell.charge -= 2000 + if(istype(target_human) && target_human.species.name == SPECIES_ADHERENT) + next_click = world.time + 2 SECONDS + return + if(isrobot(target)) + target.apply_damage(100, DAMAGE_BURN, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("[adherent] touches [target] with bright electrical arc connecting them.")) + to_chat(target, SPAN_DANGER("You detect damage to your components!")) + else if(ishuman(target)) + target.electrocute_act(100, src, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("With bright electrical flash [adherent] touches [target] using it's tentacles.")) + else + target.apply_damage(100, DAMAGE_BURN, def_zone = src.zone_sel.selecting) + visible_message(SPAN_DANGER("With bright electrical flash [adherent] touches [target] using it's tentacles.")) + admin_attack_log(src, target, "Has electrocuted", "Has been electrocuted", "electrocuted") + target.throw_at(get_step(target,get_dir(src,target)), 5, 10) + next_click = world.time + 2 SECONDS + return + return ..() diff --git a/mods/_master_files/code/modules/species/station/adherent.dm b/mods/_master_files/code/modules/species/station/adherent.dm new file mode 100644 index 0000000000000..35526f1326f41 --- /dev/null +++ b/mods/_master_files/code/modules/species/station/adherent.dm @@ -0,0 +1,4 @@ +/datum/species/adherent/New() + LAZYINITLIST(inherent_verbs) + inherent_verbs += /mob/living/carbon/human/proc/toggle_emergency_discharge + ..() diff --git a/mods/adherent_discharge/README.md b/mods/adherent_discharge/README.md new file mode 100644 index 0000000000000..7aa1bf23c2ee0 --- /dev/null +++ b/mods/adherent_discharge/README.md @@ -0,0 +1,74 @@ + +#### Список PRов: + +- https://github.com/SierraBay/SierraBay12/pull/1653 + + + +## Adherent Discharge + +ID мода: ADHERENT_DISCHARGE + + +### Описание мода + +Этот мод служит примером для разработчиков и существует лишь для того, +чтобы его можно было легко скопировать и вставить в другое место. + + +### Изменения *кор кода* + +- Отсутствуют + + +### Оверрайды + +- `mods/_master_files/code/_onclick/click.dm`: `/mob/living/carbon/human/AltClickOn()` +- `mods/_master_files/code/modules/species/station/adherent.dm`: `/datum/species/adherent/New()` + + +### Дефайны + +- Отсутствуют + + +### Используемые файлы, не содержащиеся в модпаке + +- Отсутствуют + + +### Авторы: + +Lexanx diff --git a/mods/adherent_discharge/_adherent_discharge.dm b/mods/adherent_discharge/_adherent_discharge.dm new file mode 100644 index 0000000000000..ee2718ce2524d --- /dev/null +++ b/mods/adherent_discharge/_adherent_discharge.dm @@ -0,0 +1,4 @@ +/singleton/modpack/adherent_discharge + name = "Adherent Discharge" + desc = "Добавляет Адхерентам кнопку удара электричеством." + author = "Lexanx" diff --git a/mods/adherent_discharge/_adherent_discharge.dme b/mods/adherent_discharge/_adherent_discharge.dme new file mode 100644 index 0000000000000..c8a66146a6812 --- /dev/null +++ b/mods/adherent_discharge/_adherent_discharge.dme @@ -0,0 +1,6 @@ +#ifndef MODPACK_ADHERENT_DISCHARGE +#define MODPACK_ADHERENT_DISCHARGE + +#include "_adherent_discharge.dm" +#include "code/adherent.dm" +#endif diff --git a/mods/adherent_discharge/code/adherent.dm b/mods/adherent_discharge/code/adherent.dm new file mode 100644 index 0000000000000..681dec209ae83 --- /dev/null +++ b/mods/adherent_discharge/code/adherent.dm @@ -0,0 +1,21 @@ +/obj/item/organ/internal/cell/adherent + var/ready_to_charge + + +/mob/living/carbon/human/proc/toggle_emergency_discharge() + set category = "Abilities" + set name = "Toggle emergency discharge" + set desc = "Allows you to overload your piezo capacitors." + + var/mob/living/carbon/human/adherent = src + var/obj/item/organ/internal/cell/adherent/adherent_core = adherent.internal_organs_by_name[BP_CELL] + if(!adherent_core.ready_to_charge) + adherent_core.ready_to_charge = TRUE + to_chat(src, SPAN_WARNING("The emergency discharge is ready for use.")) + to_chat(src, SPAN_GOOD("You are ready to discharge, use alt+click on target to electrocute them.")) + adherent.visible_message(SPAN_WARNING("You hear silent crackle sounds from [adherent] tentacles")) + playsound(loc, 'mods/adherent_discharge/sounds/discharge_on.ogg', 40, 1) + return + + adherent_core.ready_to_charge = FALSE + to_chat(src, SPAN_WARNING("You have relieved the tension of your tentacles.")) diff --git a/mods/adherent_discharge/sounds/discharge_on.ogg b/mods/adherent_discharge/sounds/discharge_on.ogg new file mode 100644 index 0000000000000..dcb9e407eb65c Binary files /dev/null and b/mods/adherent_discharge/sounds/discharge_on.ogg differ diff --git a/mods/global_modpacks.dm b/mods/global_modpacks.dm index 2d50f1543e86b..415b50b4fefee 100644 --- a/mods/global_modpacks.dm +++ b/mods/global_modpacks.dm @@ -1,5 +1,6 @@ // SIERRA TODO: GET RID OF IT!!! #include "ai/_ai.dme" +#include "adherent_discharge/_adherent_discharge.dme" #include "body_markings/_body_markings.dme" #include "client_verbs/_client_verbs.dme" // #include "don_loadout/_don_loadout.dme" // Не открывать до Рождества diff --git a/mods/ipc_cooling_unit/code/machine.dm b/mods/ipc_cooling_unit/code/machine.dm index e820bb1ea56b6..d3f96db15abcd 100644 --- a/mods/ipc_cooling_unit/code/machine.dm +++ b/mods/ipc_cooling_unit/code/machine.dm @@ -19,7 +19,7 @@ if(statpanel("Status")) var/obj/item/organ/internal/cell/potato = internal_organs_by_name[BP_CELL] var/obj/item/organ/internal/cooling_system/coolant = internal_organs_by_name[BP_COOLING] - if(potato && potato.cell) + if(potato && potato.cell && src.is_species(SPECIES_IPC)) stat("Coolant remaining:","[coolant.get_coolant_remaining()]/[coolant.refrigerant_max]") /obj/item/organ/internal/cell/Process()