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

[MIRROR] Skillchips are now copied to bitrunning avatars, plus a new chip to dodge bullets while flipping. #2531

Merged
merged 1 commit into from
Mar 24, 2024
Merged
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
3 changes: 3 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,9 @@ GLOBAL_LIST_INIT(layers_to_offset, list(
/// Types of bullets that mining mobs take full damage from
#define MINING_MOB_PROJECTILE_VULNERABILITY list(BRUTE)

/// The duration of the flip emote animation
#define FLIP_EMOTE_DURATION 0.7 SECONDS

// Sprites for photocopying butts
#define BUTT_SPRITE_HUMAN_MALE "human_male"
#define BUTT_SPRITE_HUMAN_FEMALE "human_female"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_ADAMANTINE_EXTRACT_ARMOR "adamantine_extract_armor"
/// Mobs with this trait won't be able to dual wield guns.
#define TRAIT_NO_GUN_AKIMBO "no_gun_akimbo"
/// Mobs with this trait cannot be hit by projectiles, meaning the projectiles will just go through.
#define TRAIT_UNHITTABLE_BY_PROJECTILES "unhittable_by_projectiles"

/// Projectile with this trait will always hit the defined zone of a struck living mob.
#define TRAIT_ALWAYS_HIT_ZONE "always_hit_zone"
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_AI_PAUSED" = TRAIT_AI_PAUSED,
"TRAIT_BANNED_FROM_CARGO_SHUTTLE" = TRAIT_BANNED_FROM_CARGO_SHUTTLE,
"TRAIT_BEING_SHOCKED" = TRAIT_BEING_SHOCKED,
"TRAIT_COMMISSIONED" = TRAIT_COMMISSIONED,
"TRAIT_CLIMBABLE" = TRAIT_CLIMBABLE,
"TRAIT_CURRENTLY_CLEANING" = TRAIT_CURRENTLY_CLEANING,
"TRAIT_CUSTOMIZABLE_REAGENT_HOLDER" = TRAIT_CUSTOMIZABLE_REAGENT_HOLDER,
Expand All @@ -25,7 +26,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_RUSTY" = TRAIT_RUSTY,
"TRAIT_SPINNING" = TRAIT_SPINNING,
"TRAIT_STICKERED" = TRAIT_STICKERED,
"TRAIT_COMMISSIONED" = TRAIT_COMMISSIONED,
"TRAIT_UNHITTABLE_BY_PROJECTILES" = TRAIT_UNHITTABLE_BY_PROJECTILES,
),
/atom/movable = list(
"TRAIT_ACTIVE_STORAGE" = TRAIT_ACTIVE_STORAGE,
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/admin_tooling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

GLOBAL_LIST_INIT(admin_visible_traits, list(
/atom = list(
"TRAIT_UNHITTABLE_BY_PROJECTILES" = TRAIT_UNHITTABLE_BY_PROJECTILES,
"TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER,
),
/atom/movable = list(
Expand Down
23 changes: 23 additions & 0 deletions code/modules/bitrunning/orders/bepis.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/datum/orderable_item/bepis
category_index = CATEGORY_BEPIS

/datum/orderable_item/bepis/circuit_stack
item_path = /obj/item/stack/circuit_stack/full
cost_per_order = 150

/datum/orderable_item/bepis/survival_pen
item_path = /obj/item/pen/survival
cost_per_order = 150

/datum/orderable_item/bepis/party_sleeper
item_path = /obj/item/circuitboard/machine/sleeper/party
cost_per_order = 750
desc = "A decommissioned sleeper circuitboard, repurposed for recreational purposes."

/datum/orderable_item/bepis/sprayoncan
item_path = /obj/item/toy/sprayoncan
cost_per_order = 750

/datum/orderable_item/bepis/pristine
item_path = /obj/item/disk/design_disk/bepis/remove_tech
cost_per_order = 1000
32 changes: 0 additions & 32 deletions code/modules/bitrunning/orders/disks.dm

This file was deleted.

49 changes: 31 additions & 18 deletions code/modules/bitrunning/orders/tech.dm
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
/datum/orderable_item/bepis
category_index = CATEGORY_BEPIS
/datum/orderable_item/bitrunning_tech
category_index = CATEGORY_BITRUNNING_TECH

/datum/orderable_item/bepis/circuit_stack
item_path = /obj/item/stack/circuit_stack/full
cost_per_order = 150

/datum/orderable_item/bepis/survival_pen
item_path = /obj/item/pen/survival
cost_per_order = 150
/datum/orderable_item/bitrunning_tech/item_tier1
cost_per_order = 1000
item_path = /obj/item/bitrunning_disk/item/tier1
desc = "This disk contains a program that lets you equip a medical beamgun, a C4 explosive, or a box of infinite pizza."

/datum/orderable_item/bepis/party_sleeper
item_path = /obj/item/circuitboard/machine/sleeper/party
cost_per_order = 750
desc = "A decommissioned sleeper circuitboard, repurposed for recreational purposes."
/datum/orderable_item/bitrunning_tech/item_tier2
cost_per_order = 1500
item_path = /obj/item/bitrunning_disk/item/tier2
desc = "This disk contains a program that lets you equip a luxury medipen, a pistol, or an armour vest."

/datum/orderable_item/bepis/sprayoncan
item_path = /obj/item/toy/sprayoncan
cost_per_order = 750
/datum/orderable_item/bitrunning_tech/item_tier3
cost_per_order = 2500
item_path = /obj/item/bitrunning_disk/item/tier3
desc = "This disk contains a program that lets you equip an advanced energy gun, a dual bladed energy sword, or a minibomb."

/datum/orderable_item/bepis/pristine
item_path = /obj/item/disk/design_disk/bepis/remove_tech
/datum/orderable_item/bitrunning_tech/ability_tier1
cost_per_order = 1000
item_path = /obj/item/bitrunning_disk/ability/tier1
desc = "This disk contains a program that lets you cast Summon Cheese or Lesser Heal."

/datum/orderable_item/bitrunning_tech/ability_tier2
cost_per_order = 1800
item_path = /obj/item/bitrunning_disk/ability/tier2
desc = "This disk contains a program that lets you cast Fireball, Lightning Bolt, or Forcewall."

/datum/orderable_item/bitrunning_tech/ability_tier3
cost_per_order = 3200
item_path = /obj/item/bitrunning_disk/ability/tier3
desc = "This disk contains a program that lets you shapeshift into a lesser ashdrake, or a polar bear."

/datum/orderable_item/bitrunning_tech/flip_skillchip
item_path = /obj/item/skillchip/matrix_flip
cost_per_order = 2000
8 changes: 8 additions & 0 deletions code/modules/bitrunning/server/obj_generation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,11 @@

if(failed)
to_chat(neo, span_warning("One of your disks failed to load. Check for duplicate or inactive disks."))

var/obj/item/organ/internal/brain/neo_brain = neo.get_organ_slot(ORGAN_SLOT_BRAIN)
for(var/obj/item/skillchip/skill_chip as anything in neo_brain?.skillchips)
if(!skill_chip.active)
continue
var/obj/item/skillchip/clone_chip = new skill_chip.type
avatar.implant_skillchip(clone_chip, force = TRUE)
clone_chip.try_activate_skillchip(silent = TRUE, force = TRUE)
25 changes: 25 additions & 0 deletions code/modules/library/skill_learning/skillchip.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,4 +507,29 @@
activate_message = span_notice("You think of your favourite food and realise that you can rotate its flavour in your mind.")
deactivate_message = span_notice("You feel your food-based mind palace crumbling...")

/obj/item/skillchip/matrix_flip
name = "BULLET_DODGER skillchip"
skill_name = "Flip 2 Dodge"
skill_description = "At the cost of stamina, your flips can also be used to dodge incoming projectiles."
skill_icon = FA_ICON_SPINNER
activate_message = span_notice("You feel the urge to flip scenically as if you are the 'Chosen One'.")
deactivate_message = span_notice("The urge to flip goes away.")

/obj/item/skillchip/matrix_flip/on_activate(mob/living/carbon/user, silent = FALSE)
. = ..()
RegisterSignal(user, COMSIG_MOB_EMOTED("flip"), PROC_REF(on_flip))

/obj/item/skillchip/matrix_flip/on_deactivate(mob/living/carbon/user, silent=FALSE)
UnregisterSignal(user, COMSIG_MOB_EMOTED("flip"))
return ..()

/obj/item/skillchip/matrix_flip/proc/on_flip(mob/living/source)
SIGNAL_HANDLER
if(HAS_TRAIT_FROM(source, TRAIT_UNHITTABLE_BY_PROJECTILES, SKILLCHIP_TRAIT))
return
playsound(source, 'sound/weapons/fwoosh.ogg', 90, FALSE)
ADD_TRAIT(source, TRAIT_UNHITTABLE_BY_PROJECTILES, SKILLCHIP_TRAIT)
source.adjustStaminaLoss(20)
addtimer(TRAIT_CALLBACK_REMOVE(source, TRAIT_UNHITTABLE_BY_PROJECTILES, SKILLCHIP_TRAIT), FLIP_EMOTE_DURATION + 0.1 SECONDS)

#undef SKILLCHIP_CATEGORY_GENERAL
2 changes: 1 addition & 1 deletion code/modules/mob/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
/datum/emote/flip/run_emote(mob/user, params , type_override, intentional)
. = ..()
if(.)
user.SpinAnimation(7,1)
user.SpinAnimation(FLIP_EMOTE_DURATION,1)

/datum/emote/flip/check_cooldown(mob/user, intentional)
. = ..()
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@
// if pass_flags match, pass through entirely - unless direct target is set.
if((target.pass_flags_self & pass_flags) && !direct_target)
return FALSE
if(HAS_TRAIT(target, TRAIT_UNHITTABLE_BY_PROJECTILES))
return FALSE
if(!ignore_source_check && firer)
var/mob/M = firer
if((target == firer) || ((target == firer.loc) && ismecha(firer.loc)) || (target in firer.buckled_mobs) || (istype(M) && (M.buckled == target)))
Expand Down
2 changes: 1 addition & 1 deletion tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3543,7 +3543,7 @@
#include "code\modules\bitrunning\objects\netpod.dm"
#include "code\modules\bitrunning\objects\quantum_console.dm"
#include "code\modules\bitrunning\objects\vendor.dm"
#include "code\modules\bitrunning\orders\disks.dm"
#include "code\modules\bitrunning\orders\bepis.dm"
#include "code\modules\bitrunning\orders\flair.dm"
#include "code\modules\bitrunning\orders\tech.dm"
#include "code\modules\bitrunning\server\_parent.dm"
Expand Down
Loading