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

Locks on spotter kit. #4114

Closed
wants to merge 1 commit into from
Closed
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
99 changes: 89 additions & 10 deletions code/modules/cm_marines/equipment/kit_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
new /obj/item/weapon/gun/rifle/sniper/M42A(src)
new /obj/item/facepaint/sniper(src)
// spotter
new /obj/item/storage/box/kit/spotter(src)
new /obj/item/storage/box/kit/companion/spotter(src)

/obj/item/storage/box/spec/scout
name = "\improper Scout equipment case"
Expand Down Expand Up @@ -525,22 +525,101 @@
new /obj/item/ammo_magazine/shotgun/buckshot(src)
new /obj/item/ammo_magazine/shotgun/buckshot(src)

/obj/item/storage/box/kit/spotter
/obj/item/storage/box/kit/engineering_supply_kit
name = "\improper Engineering Supply Kit"

/obj/item/storage/box/kit/engineering_supply_kit/fill_preset_inventory()
new /obj/item/storage/pouch/construction/low_grade_full(src)
new /obj/item/storage/pouch/electronics/full(src)
new /obj/item/clothing/glasses/welding(src)


///A kit that is issued by one human to another.
/obj/item/storage/box/kit/companion
var/issuer
var/datum/squad/associated_squad
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null on destroy

var/associated_fireteam
var/recipient
Comment on lines +539 to +542
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code doc pls


/obj/item/storage/box/kit/companion/open(mob/user)
if(!recipient)
to_chat(user, SPAN_WARNING("[src] is not fully unlocked yet!"))
return
..()

/obj/item/storage/box/kit/companion/attackby(obj/item/card/id/card, mob/user)
if(!istype(card))
return ..()
if(card.registered_ref != WEAKREF(user))
to_chat(user, SPAN_WARNING("You should use your own ID!"))
return
if(!issuer)
register_issuer(user)
return
if(!recipient)
register_recipient(user, card)
return
return ..()

/obj/item/storage/box/kit/companion/proc/register_issuer(mob/living/carbon/human/user)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code doc

issuer = user.real_name
associated_squad = user.assigned_squad
associated_fireteam = user.assigned_fireteam

/obj/item/storage/box/kit/companion/proc/register_recipient(mob/living/carbon/human/user, obj/item/card/id/card)
Comment on lines +564 to +569
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code doc

recipient = user.real_name
if(associated_squad)
transfer_marine_to_squad(user, associated_squad, user.assigned_squad, card)
if(associated_fireteam)
associated_squad.assign_fireteam(associated_fireteam, user)


/obj/item/storage/box/kit/companion/spotter
name = "\improper Spotter Kit"
desc = "A locked and sealed box, containing a set of spotter's equipment and instructions in its usage."
pro_case_overlay = "spotter"
var/datum/character_trait/trait_to_apply = /datum/character_trait/skills/spotter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null on destroy pls


/obj/item/storage/box/kit/companion/spotter/Initialize()
. = ..()
trait_to_apply = GLOB.character_traits[trait_to_apply]

/obj/item/storage/box/kit/spotter/fill_preset_inventory()
/obj/item/storage/box/kit/companion/spotter/get_examine_text(mob/user)
. = ..()
if(!issuer)
. += SPAN_NOTICE("It can be unlocked by sniper specialist's ID.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. += SPAN_NOTICE("It can be unlocked by sniper specialist's ID.")
. += SPAN_NOTICE("It can be unlocked by swiping the sniper specialist's ID.")

return
. += SPAN_NOTICE("It has been issued by [issuer][associated_squad ? ", [associated_squad] squad" : ""].")
if(recipient)
. += SPAN_NOTICE("It has been claimed by [recipient].")
else
. += SPAN_NOTICE("It is still sealed. It can be claimed by squad rifleman's ID.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
. += SPAN_NOTICE("It is still sealed. It can be claimed by squad rifleman's ID.")
. += SPAN_NOTICE("It is still sealed. It can be claimed by swiping a squad rifleman's ID.")


/obj/item/storage/box/kit/companion/spotter/fill_preset_inventory()
new /obj/item/clothing/head/helmet/marine/ghillie(src)
new /obj/item/clothing/suit/storage/marine/ghillie(src)
new /obj/item/clothing/glasses/night/m42_night_goggles/spotter(src)
new /obj/item/storage/backpack/marine/smock(src)
new /obj/item/device/binoculars/range/designator/spotter(src)
new /obj/item/pamphlet/skill/spotter(src)

/obj/item/storage/box/kit/engineering_supply_kit
name = "\improper Engineering Supply Kit"
/obj/item/storage/box/kit/companion/spotter/register_issuer(mob/living/carbon/human/user)
if(user.skills.get_skill_level(SKILL_SPEC_WEAPONS) != SKILL_SPEC_SNIPER)
to_chat(user, SPAN_WARNING("[src] can only be unlocked by the sniper specialist."))
return
..()
to_chat(user, SPAN_NOTICE("You have registered as the issuer of [src]. Give it to a squad rifleman of your choice or leave it in the open to be taken by a volunteer."))

/obj/item/storage/box/kit/engineering_supply_kit/fill_preset_inventory()
new /obj/item/storage/pouch/construction/low_grade_full(src)
new /obj/item/storage/pouch/electronics/full(src)
new /obj/item/clothing/glasses/welding(src)
/obj/item/storage/box/kit/companion/spotter/register_recipient(mob/living/carbon/human/user, obj/item/card/id/card)
if(user.job != JOB_SQUAD_MARINE)
to_chat(user, SPAN_WARNING("Only squad riflemen can be issued a spotter kit."))
return
if(user.rank_fallback)
to_chat(user, SPAN_WARNING("You already have a special assignment."))
return
..()
user.rank_fallback = "ass"
user.hud_set_squad()
card.set_assignment((user.assigned_squad ? (user.assigned_squad.name + " ") : "") + "Spotter")
GLOB.data_core.manifest_modify(user.real_name, WEAKREF(user), "Spotter")
trait_to_apply.apply_trait(user)
to_chat(user, SPAN_NOTICE("You unseal [src] and open it, reading the instructions on the inside."))
Loading