-
Notifications
You must be signed in to change notification settings - Fork 84
Изменения Псионики и добавление Лонера #5839
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
Draft
Saukykouko
wants to merge
22
commits into
Fluffy-Frontier:master
Choose a base branch
from
Saukykouko:loner
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c125704
трогаем код
Saukykouko b7b71bd
исправляем код (пытаемся)
Saukykouko 4c0e6d5
сохраняем код
Saukykouko 54c9cbc
исправляем код
Saukykouko 8d6bf8d
допиливаем все что нужно
Saukykouko 845be74
Исправления багов
Saukykouko c362d8d
Добавляем новые спеллы, исправляем баги
Saukykouko f422eba
исправляем баги
Saukykouko 9293ae9
новая абилка, исправление багов
Saukykouko 001ac45
Переименовываем под более понятное название
Saukykouko 5619a65
Я передумал
Saukykouko 8302ec5
обновление
Saukykouko c02fa4d
исправляем ошибку тестов
Saukykouko 57f0671
исправление бага
Saukykouko 225f497
фильтруем спеллы, обновляем фокус и добавляем пару новых
Saukykouko f564ecf
исправление ошибки
Saukykouko d9ae987
обновления
Saukykouko 59aa8ab
исправления баланса и бага
Saukykouko a3f0b3f
Update mending.dm
Saukykouko b0e3f29
исправляем АП пули
Saukykouko 2a4b582
Update stamina.dm
Saukykouko f315d27
Update transparency.dm
Saukykouko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,13 @@ | ||
| #define TRAIT_PSIONIC_USER "psionicuser" | ||
| #define TRAIT_PSIONIC_IMPLANT "psionic_implant" | ||
| #define TRAIT_PSIONIC_SUPPRESSED "psionic_suppressed" | ||
| #define TRAIT_PSIONIC_EXHAUSTION "psionic_exhaustion" | ||
| #define TRAIT_ZONA_BOVINAE_ABSORBED "zona_bovinae_absorbed" | ||
| #define TRAIT_PSIONIC_INFLUENCED "psionic_influenced" | ||
| #define SUNDER_TRAIT "sunder_trait" | ||
| #define PSIONIC_TRAIT "psionic_trait" | ||
| #define HUD_PSI_DISPLAY "hud_psi_display" | ||
| #define HUD_PSI_SIGNAL "hud_psi_signal" | ||
| #define HUD_PSIONIC_ARROW "psionic_arrow" | ||
| #define FACTION_PSIONIC "faction_psionic" | ||
| #define VV_HK_GIVE_PSIONIC "give_psionic" |
This file contains hidden or 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
259 changes: 259 additions & 0 deletions
259
tff_modular/modules/psionics/code/_psionic_abilities.dm
This file contains hidden or 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,259 @@ | ||
| // Тут хранятся некрасивые базовые классы и прочее. Не смотрите сюда. | ||
|
|
||
| /datum/action/cooldown/spell | ||
| // Сколько маны стоит кастануть спелл | ||
| var/mana_cost = 10 | ||
| // Что написать жертве | ||
| var/target_msg | ||
| // Сила способности | ||
| var/cast_power = 0 | ||
| // Является псионическим спеллом? Нужен чтобы потом удалить их | ||
| var/psionic = FALSE | ||
| // Уровень способности, определяет может ли ее купить псионик | ||
| var/psionic_level = 1 | ||
| // Датум псионики что используется при касте | ||
| var/datum/psionic/psionic_datum | ||
| // Категория | ||
| var/category = "Tier 1" | ||
| // Цена | ||
| var/point_cost = 1 | ||
| // Текст помощи | ||
| var/helptext = "" | ||
| // Доступ | ||
| var/locked = TRUE | ||
| // Игнорируем ли мы подавление/отсутствие маны? | ||
| var/ignore_suppression = FALSE | ||
|
|
||
| /datum/action/cooldown/spell/Grant(mob/grant_to) | ||
| . = ..() | ||
| if(psionic) | ||
| var/mob/living/our_psionic = grant_to | ||
| psionic_datum = our_psionic.get_psionic() | ||
| cast_power = psionic_datum.psionic_level | ||
|
|
||
| /datum/action/cooldown/spell/update_button_name(atom/movable/screen/movable/action_button/button, force) | ||
| . = ..() | ||
| if(mana_cost) | ||
| button.desc += " Costs [mana_cost] Psi Energy." | ||
|
|
||
| // Спеллы для призвания предмета | ||
| /datum/action/cooldown/spell/conjure_item/psionic | ||
| button_icon = 'tff_modular/modules/psionics/icons/spells.dmi' | ||
| background_icon_state = "bg_tech_blue" | ||
| overlay_icon_state = "bg_tech_blue_border" | ||
| delete_old = FALSE | ||
| delete_on_failure = TRUE | ||
| requires_hands = TRUE | ||
| // Псионические способности (в основном) не блокируются, но выводят особенные сообщения тем, кто это может | ||
| antimagic_flags = MAGIC_RESISTANCE_MIND | ||
| spell_requirements = NONE | ||
| cooldown_reduction_per_rank = 0 SECONDS | ||
| psionic = TRUE | ||
|
|
||
| // Проверяем достаточно ли маны | ||
| /datum/action/cooldown/spell/proc/check_for_mana() | ||
| var/mob/living/carbon/human/caster = owner | ||
| var/datum/psionic/psi_holder = caster.get_psionic() | ||
| if(!psi_holder) | ||
| return FALSE | ||
| if(HAS_TRAIT(caster, TRAIT_PSIONIC_EXHAUSTION)) | ||
| return FALSE | ||
| if(HAS_TRAIT(caster, TRAIT_PSIONIC_SUPPRESSED)) | ||
| if(ignore_suppression) | ||
| return TRUE | ||
| return FALSE | ||
| return TRUE | ||
|
|
||
| // Сосём ману у псионика | ||
| /datum/action/cooldown/spell/proc/drain_mana() | ||
| var/mob/living/carbon/human/caster = owner | ||
| var/datum/psionic/psi_holder = caster.get_psionic() | ||
| if(psi_holder) | ||
| psi_holder.adjust_psi_energy(-mana_cost) | ||
| return TRUE | ||
| else | ||
| return FALSE | ||
|
|
||
| /datum/action/cooldown/spell/conjure_item/psionic/before_cast(atom/cast_on) | ||
| . = ..() | ||
| if(!check_for_mana()) | ||
| return SPELL_CANCEL_CAST | ||
|
|
||
| /datum/action/cooldown/spell/conjure_item/psionic/cast(atom/cast_on) | ||
| drain_mana() | ||
| return ..() | ||
|
|
||
| // Для спеллов которые применяются на себя тыком кнопки a.k.a. выдача генов | ||
| /datum/action/cooldown/spell/psionic | ||
| button_icon = 'tff_modular/modules/psionics/icons/spells.dmi' | ||
| background_icon_state = "bg_tech_blue" | ||
| overlay_icon_state = "bg_tech_blue_border" | ||
| // Псионические способности (в основном) не блокируются, но выводят особенные сообщения тем, кто это может | ||
| antimagic_flags = MAGIC_RESISTANCE_MIND | ||
|
|
||
| school = SCHOOL_UNSET | ||
| invocation_type = INVOCATION_NONE | ||
| spell_requirements = NONE | ||
| cooldown_reduction_per_rank = 0 SECONDS | ||
| psionic = TRUE | ||
| psionic_level = 1 | ||
|
|
||
| /datum/action/cooldown/spell/psionic/before_cast(atom/cast_on) | ||
| . = ..() | ||
| if(!check_for_mana()) | ||
| return SPELL_CANCEL_CAST | ||
|
|
||
| // Спеллы для пострелушек | ||
| /datum/action/cooldown/spell/pointed/projectile/psionic | ||
| button_icon = 'tff_modular/modules/psionics/icons/spells.dmi' | ||
| background_icon_state = "bg_tech_blue" | ||
| overlay_icon_state = "bg_tech_blue_border" | ||
| // Псионические способности (в основном) не блокируются, но выводят особенные сообщения тем, кто это может | ||
| antimagic_flags = MAGIC_RESISTANCE_MIND | ||
|
|
||
| school = SCHOOL_UNSET | ||
| invocation_type = INVOCATION_NONE | ||
| spell_requirements = NONE | ||
| cooldown_reduction_per_rank = 0 SECONDS | ||
| psionic = TRUE | ||
| cast_range = 7 | ||
|
|
||
| /datum/action/cooldown/spell/pointed/projectile/psionic/before_cast(atom/cast_on) | ||
| . = ..() | ||
| if(!check_for_mana()) | ||
| return SPELL_CANCEL_CAST | ||
|
|
||
| // Направленные спеллы a.k.a. псионик выбирают цель на дистанции | ||
| /datum/action/cooldown/spell/pointed/psionic | ||
| button_icon = 'tff_modular/modules/psionics/icons/spells.dmi' | ||
| background_icon_state = "bg_tech_blue" | ||
| overlay_icon_state = "bg_tech_blue_border" | ||
| // Псионические способности (в основном) не блокируются, но выводят особенные сообщения тем, кто это может | ||
| antimagic_flags = MAGIC_RESISTANCE_MIND | ||
| school = SCHOOL_UNSET | ||
| invocation_type = INVOCATION_NONE | ||
| spell_requirements = NONE | ||
| cooldown_reduction_per_rank = 0 SECONDS | ||
| psionic = TRUE | ||
| cast_range = 7 | ||
|
|
||
| /datum/action/cooldown/spell/pointed/psionic/before_cast(atom/cast_on) | ||
| . = ..() | ||
| if(!check_for_mana()) | ||
| return SPELL_CANCEL_CAST | ||
|
|
||
| // Спеллы которыми надо коснуться чего либо. Перед активацией имеется "этап активации" заклинания. | ||
| /datum/action/cooldown/spell/touch/psionic | ||
| button_icon = 'tff_modular/modules/psionics/icons/spells.dmi' | ||
| background_icon_state = "bg_tech_blue" | ||
| overlay_icon_state = "bg_tech_blue_border" | ||
| // Псионические способности (в основном) не блокируются, но выводят особенные сообщения тем, кто это может | ||
| antimagic_flags = MAGIC_RESISTANCE_MIND | ||
| school = SCHOOL_UNSET | ||
| invocation_type = INVOCATION_NONE | ||
| spell_requirements = NONE | ||
| psionic = TRUE | ||
| var/channel_message | ||
| var/currently_channeling = FALSE | ||
| var/channel_time = 1 SECONDS | ||
| var/channel_flags = IGNORE_USER_LOC_CHANGE|IGNORE_HELD_ITEM | ||
| var/charge_overlay_icon = 'icons/effects/effects.dmi' | ||
| var/charge_overlay_state = "lighting" | ||
| var/mutable_appearance/charge_overlay_instance | ||
| var/charge_sound = 'tff_modular/modules/psionics/sounds/power_evoke.ogg' | ||
| var/sound/charge_sound_instance | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/New(Target, original) | ||
| . = ..() | ||
| if(!channel_message) | ||
| channel_message = span_notice("You start charging [src]...") | ||
|
|
||
| if(charge_sound) | ||
| charge_sound_instance = sound(charge_sound, channel = CHANNEL_CHARGED_SPELL) | ||
|
|
||
| if(charge_overlay_icon && charge_overlay_state) | ||
| charge_overlay_instance = mutable_appearance(charge_overlay_icon, charge_overlay_state, EFFECTS_LAYER) | ||
|
|
||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/Destroy() | ||
| if(owner) | ||
| stop_channel_effect(owner) | ||
|
|
||
| charge_overlay_instance = null | ||
| charge_sound_instance = null | ||
| return ..() | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/Remove(mob/living/remove_from) | ||
| stop_channel_effect(remove_from) | ||
| return ..() | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/is_action_active(atom/movable/screen/movable/action_button/current_button) | ||
| return currently_channeling | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/can_cast_spell(feedback = TRUE) | ||
| . = ..() | ||
| if(!.) | ||
| return FALSE | ||
| if(currently_channeling) | ||
| if(feedback) | ||
| to_chat(owner, span_warning("You're already channeling [src]!")) | ||
| return FALSE | ||
| if(!check_for_mana()) | ||
| return FALSE | ||
| return TRUE | ||
|
|
||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/before_cast(atom/cast_on) | ||
| . = ..() | ||
| if(. & SPELL_CANCEL_CAST) | ||
| return | ||
| if(!check_for_mana()) | ||
| return SPELL_CANCEL_CAST | ||
| to_chat(owner, channel_message) | ||
|
|
||
| if(charge_sound_instance) | ||
| playsound(owner, charge_sound_instance, 50, FALSE) | ||
|
|
||
| if(charge_overlay_instance) | ||
| owner.add_overlay(charge_overlay_instance) | ||
|
|
||
| currently_channeling = TRUE | ||
| build_all_button_icons(UPDATE_BUTTON_STATUS) | ||
| if(!do_after(owner, channel_time, timed_action_flags = channel_flags)) | ||
| stop_channel_effect(owner) | ||
| return . | SPELL_CANCEL_CAST | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/cast(atom/cast_on) | ||
| . = ..() | ||
| stop_channel_effect(owner) | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/proc/stop_channel_effect(mob/for_who) | ||
| if(charge_overlay_instance) | ||
| for_who.cut_overlay(charge_overlay_instance) | ||
|
|
||
| if(charge_sound_instance) | ||
| for_who.stop_sound_channel(CHANNEL_CHARGED_SPELL) | ||
| playsound(for_who, sound(null, repeat = 0, channel = CHANNEL_CHARGED_SPELL), 50, FALSE) | ||
|
|
||
| currently_channeling = FALSE | ||
| build_all_button_icons(UPDATE_BUTTON_STATUS) | ||
|
|
||
| /datum/action/cooldown/spell/touch/psionic/create_hand(mob/living/carbon/cast_on) | ||
| . = ..() | ||
| if(!.) | ||
| return . | ||
| return TRUE | ||
|
|
||
| /particles/droplets/psionic | ||
| icon = 'icons/effects/particles/generic.dmi' | ||
| icon_state = list("dot"=2,"drop"=1) | ||
| width = 32 | ||
| height = 36 | ||
| count = 20 | ||
| spawning = 0.2 | ||
| lifespan = 1.5 SECONDS | ||
| fade = 0.5 SECONDS | ||
| color = "#00a2ff" | ||
| position = generator(GEN_BOX, list(-9,-9,0), list(9,18,0), NORMAL_RAND) | ||
| scale = generator(GEN_VECTOR, list(0.9,0.9), list(1.1,1.1), NORMAL_RAND) | ||
| gravity = list(0, 0.95) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.