forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: SuhEugene <[email protected]>
- Loading branch information
Showing
10 changed files
with
168 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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("<b>Your [target_cell] has been charged.</b>")) | ||
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("<b>You detect damage to your components!</b>")) | ||
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 ..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/datum/species/adherent/New() | ||
LAZYINITLIST(inherent_verbs) | ||
inherent_verbs += /mob/living/carbon/human/proc/toggle_emergency_discharge | ||
..() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
#### Список PRов: | ||
|
||
- https://github.com/SierraBay/SierraBay12/pull/1653 | ||
<!-- | ||
Ссылки на PRы, связанные с модом: | ||
- Создание | ||
- Большие изменения | ||
--> | ||
|
||
<!-- Название мода. Не важно на русском или на английском. --> | ||
## 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()` | ||
<!-- | ||
Если ты добавлял новый модульный оверрайд, его нужно указать здесь. | ||
Здесь указываются оверрайды в твоём моде и папке `_master_files` | ||
Изменений нет - напиши "Отсутствуют" | ||
--> | ||
|
||
### Дефайны | ||
|
||
- Отсутствуют | ||
<!-- | ||
Если требовалось добавить какие-либо дефайны, укажи файлы, | ||
в которые ты их добавил, а также перечисли имена. | ||
И то же самое, если ты используешь дефайны, определённые другим модом. | ||
Не используешь - напиши "Отсутствуют" | ||
--> | ||
|
||
### Используемые файлы, не содержащиеся в модпаке | ||
|
||
- Отсутствуют | ||
<!-- | ||
Будь то немодульный файл или модульный файл, который не содержится в папке, | ||
принадлежащей этому конкретному моду, он должен быть упомянут здесь. | ||
Хорошими примерами являются иконки или звуки, которые используются одновременно | ||
несколькими модулями, или что-либо подобное. | ||
--> | ||
|
||
### Авторы: | ||
|
||
Lexanx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/singleton/modpack/adherent_discharge | ||
name = "Adherent Discharge" | ||
desc = "Добавляет Адхерентам кнопку удара электричеством." | ||
author = "Lexanx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef MODPACK_ADHERENT_DISCHARGE | ||
#define MODPACK_ADHERENT_DISCHARGE | ||
|
||
#include "_adherent_discharge.dm" | ||
#include "code/adherent.dm" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.")) |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters