Skip to content

Commit

Permalink
port
Browse files Browse the repository at this point in the history
  • Loading branch information
CannibalHunter committed Aug 20, 2024
1 parent 4da39da commit 8f24c5e
Show file tree
Hide file tree
Showing 28 changed files with 292 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
var/mailer = null
var/mailedto = null

var/picklvl = 0

var/list/examine_effects = list()

///played when an item that is equipped blocks a hit
Expand Down
118 changes: 114 additions & 4 deletions code/game/objects/items/rogueitems/keyrings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
name = "keyring"
desc = "Will help you organize your keys."
icon_state = "keyring0"
icon = 'icons/roguetown/items/keys.dmi'
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
icon = 'icons/roguetown/items/lockpicks.dmi'
w_class = WEIGHT_CLASS_TINY
dropshrink = 0
throwforce = 0
Expand Down Expand Up @@ -124,13 +122,13 @@
else
desc = ""

//Keyrings for Jobs
/obj/item/keyring/sheriff
keys = list(/obj/item/roguekey/sheriff, /obj/item/roguekey/dungeon, /obj/item/roguekey/garrison, /obj/item/roguekey/walls, /obj/item/roguekey/manor, /obj/item/roguekey/graveyard)

/obj/item/keyring/bailiff
keys = list(/obj/item/roguekey/sheriff, /obj/item/roguekey/dungeon, /obj/item/roguekey/garrison, /obj/item/roguekey/walls, /obj/item/roguekey/manor, /obj/item/roguekey/graveyard)


/obj/item/keyring/councillor
keys = list(/obj/item/roguekey/sheriff, /obj/item/roguekey/dungeon, /obj/item/roguekey/garrison, /obj/item/roguekey/walls, /obj/item/roguekey/manor, /obj/item/roguekey/graveyard)

Expand Down Expand Up @@ -196,3 +194,115 @@

/obj/item/keyring/royal
keys = list(/obj/item/roguekey/manor, /obj/item/roguekey/royal)

//Lockpick Ring
/obj/item/lockpickring
name = "lockpickring"
desc = "A piece of bent wire to store lockpicking tools. Too bulky for fine work."
icon_state = "pickring0"
icon = 'icons/roguetown/items/lockpicks.dmi'
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
dropshrink = 0
throwforce = 0
var/list/picks = list()
slot_flags = ITEM_SLOT_HIP|ITEM_SLOT_NECK|ITEM_SLOT_MOUTH|ITEM_SLOT_WRISTS
experimental_inhand = FALSE
dropshrink = 0.7

/obj/item/lockpickring/Initialize()
. = ..()
if(picks.len)
for(var/X in picks)
addtoring(new X())
picks -= X
update_icon()

/obj/item/lockpickring/getonmobprop(tag)
. = ..()
if(tag)
switch(tag)
if("gen")
return list("shrink" = 0.4,
"sx" = -6,
"sy" = -3,
"nx" = 13,
"ny" = -3,
"wx" = -2,
"wy" = -3,
"ex" = 4,
"ey" = -5,
"northabove" = 0,
"southabove" = 1,
"eastabove" = 1,
"westabove" = 0,
"nturn" = 15,
"sturn" = 0,
"wturn" = 0,
"eturn" = 39,
"nflip" = 8,
"sflip" = 0,
"wflip" = 0,
"eflip" = 8)
if("onbelt")
return list("shrink" = 0.3,"sx" = -2,"sy" = -5,"nx" = 4,"ny" = -5,"wx" = 0,"wy" = -5,"ex" = 2,"ey" = -5,"nturn" = 0,"sturn" = 0,"wturn" = 0,"eturn" = 0,"nflip" = 0,"sflip" = 0,"wflip" = 0,"eflip" = 0,"northabove" = 0,"southabove" = 1,"eastabove" = 1,"westabove" = 0)

/obj/item/lockpickring/proc/addtoring(obj/item/I)
if(!I || !istype(I))
return 0
I.loc = src
picks += I
update_icon()
update_desc()

/obj/item/lockpickring/proc/removefromring(mob/user)
if(!picks.len)
return
var/obj/item/lockpick/K = picks[picks.len]
picks -= K
K.loc = user.loc
update_icon()
update_desc()
return K

/obj/item/lockpickring/attackby(obj/item/I, mob/user)
if(istype(I,/obj/item/lockpick))
if(picks.len >= 3)
to_chat(user, "<span class='warning'>Too many lockpicks.</span>")
return
user.dropItemToGround(I)
addtoring(I)
else
return ..()

/obj/item/lockpickring/attack_right(mob/user)
if(picks.len)
to_chat(user, "<span class='notice'>I steal a pick off the ring.</span>")
var/obj/item/lockpick/K = removefromring(user)
user.put_in_active_hand(K)

/obj/item/lockpickring/update_icon()
..()
if(!picks.len)
icon_state = "pickring0"
return
if(picks.len >= 3)
icon_state = "pickring3"
return
switch(picks.len)
if(1)
icon_state = "pickring1"
if(2)
icon_state = "pickring2"
if(3)
icon_state = "pickring3"

/obj/item/lockpickring/proc/update_desc()
if(picks.len)
desc = "<span class='info'>\Roman [picks.len] lockpicks.</span>"
else
desc = ""

/obj/item/lockpickring/mundane
picks = list(/obj/item/lockpick, /obj/item/lockpick, /obj/item/lockpick)
20 changes: 17 additions & 3 deletions code/game/objects/items/rogueitems/keys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@
GLOB.lockhashes += lockhash
GLOB.lockids[lockid] = lockhash

/obj/item/lockpick
name = "lockpick"
desc = "A small, sharp piece of metal to aid opening locks in the absence of a key."
icon_state = "lockpick"
icon = 'icons/roguetown/items/lockpicks.dmi'
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
w_class = WEIGHT_CLASS_TINY
dropshrink = 0.75
throwforce = 0
max_integrity = 10
picklvl = 1
slot_flags = ITEM_SLOT_HIP|ITEM_SLOT_MOUTH|ITEM_SLOT_NECK
destroy_sound = 'sound/items/pickbreak.ogg'

/obj/item/roguekey/lord
name = "master key"
desc = "The Lord's key."
Expand Down Expand Up @@ -172,13 +187,12 @@
icon_state = "brownkey"
lockid = "roomhunt"

//vampire mansion//
//vampire mansion
/obj/item/roguekey/vampire
name = "mansion key"
desc = "The key to a vampire lord's castle."
icon_state = "vampkey"
lockid = "mansionvampire"
//

/obj/item/roguekey/blacksmith
name = "blacksmith key"
Expand Down Expand Up @@ -434,4 +448,4 @@
KE.name = src.holdname
to_chat(user, span_notice("You add [src] to [K]."))
qdel(src)

60 changes: 60 additions & 0 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@
if(istype(W, /obj/item/roguekey) || istype(W, /obj/item/keyring))
trykeylock(W, user)
return
if(istype(W, /obj/item/lockpick))
trypicklock(W, user)
return
if(src.tool_interact(W,user))
return 1 // No afterattack
else
Expand Down Expand Up @@ -308,6 +311,63 @@
return TRUE


obj/structure/closet/proc/trypicklock(obj/item/I, mob/user)
if(opened)
to_chat(user, "<span class='warning'>This cannot be picked while it is open.</span>")
return
if(!keylock)
to_chat(user, "<span class='warning'>There's no lock on this.</span>")
return
if(broken)
to_chat(user, "<span class='warning'>The lock is broken.</span>")
return
else
var/lockprogress = 0
var/locktreshold = 100

var/obj/item/lockpick/P = I
var/mob/living/L = user

var/pickskill = user.mind.get_skill_level(/datum/skill/misc/lockpicking)
var/perbonus = L.STAPER/5
var/picktime = 70
var/pickchance = 35
var/moveup = 10

picktime -= (pickskill * 10)
picktime = clamp(picktime, 10, 70)

moveup += (pickskill * 3)
moveup = clamp(moveup, 10, 30)

pickchance += pickskill * 10
pickchance += perbonus
pickchance *= P.picklvl
pickchance = clamp(pickchance, 1, 95)

while(!QDELETED(I) &&(lockprogress < locktreshold))
if(!do_after(user, picktime, target = src))
break
if(prob(pickchance))
lockprogress += moveup
playsound(src.loc, pick('sound/items/pickgood1.ogg','sound/items/pickgood2.ogg'), 5, TRUE)
to_chat(user, "<span class='warning'>Click...</span>")
if(L.mind)
var/amt2raise = L.STAINT
var/boon = L.mind.get_learning_boon(/datum/skill/misc/lockpicking)
L.mind.adjust_experience(/datum/skill/misc/lockpicking, amt2raise * boon)
if(lockprogress >= locktreshold)
to_chat(user, "<span class='deadsay'>The locking mechanism gives.</span>")
togglelock(user)
break
else
continue
else
playsound(loc, 'sound/items/pickbad.ogg', 40, TRUE)
I.take_damage(1, BRUTE, "melee")
to_chat(user, "<span class='warning'>Clack.</span>")
continue
return

/obj/structure/closet/proc/after_weld(weld_state)
return
Expand Down
60 changes: 60 additions & 0 deletions code/game/objects/structures/mineral_doors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,69 @@
trykeylock(I, user)
// else if(user.used_intent.type != INTENT_HARM)
// return attack_hand(user)
if(istype(I, /obj/item/lockpick))
trypicklock(I, user)
else
return ..()

/obj/structure/mineral_door/proc/trypicklock(obj/item/I, mob/user)
if(door_opened || isSwitchingStates)
to_chat(user, "<span class='warning'>This cannot be picked while it is open.</span>")
return
if(!keylock)
return
if(lockbroken)
to_chat(user, "<span class='warning'>The lock to this door is broken.</span>")
user.changeNext_move(CLICK_CD_MELEE)
else
var/lockprogress = 0
var/locktreshold = 100

var/obj/item/lockpick/P = I
var/mob/living/L = user

var/pickskill = user.mind.get_skill_level(/datum/skill/misc/lockpicking)
var/perbonus = L.STAPER/5
var/picktime = 70
var/pickchance = 35
var/moveup = 10

picktime -= (pickskill * 10)
picktime = clamp(picktime, 10, 70)

moveup += (pickskill * 3)
moveup = clamp(moveup, 10, 30)

pickchance += pickskill * 10
pickchance += perbonus
pickchance *= P.picklvl
pickchance = clamp(pickchance, 1, 95)



while(!QDELETED(I) &&(lockprogress < locktreshold))
if(!do_after(user, picktime, target = src))
break
if(prob(pickchance))
lockprogress += moveup
playsound(src.loc, pick('sound/items/pickgood1.ogg','sound/items/pickgood2.ogg'), 5, TRUE)
to_chat(user, "<span class='warning'>Click...</span>")
if(L.mind)
var/amt2raise = L.STAINT
var/boon = L.mind.get_learning_boon(/datum/skill/misc/lockpicking)
L.mind.adjust_experience(/datum/skill/misc/lockpicking, amt2raise * boon)
if(lockprogress >= locktreshold)
to_chat(user, "<span class='deadsay'>The locking mechanism gives.</span>")
lock_toggle(user)
break
else
continue
else
playsound(loc, 'sound/items/pickbad.ogg', 40, TRUE)
I.take_damage(1, BRUTE, "melee")
to_chat(user, "<span class='warning'>Clack.</span>")
continue
return

/obj/structure/mineral_door/proc/trykeylock(obj/item/I, mob/user)
if(door_opened || isSwitchingStates)
Expand Down
1 change: 1 addition & 0 deletions code/modules/antagonists/roguetown/villain/bandit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/sewing, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/lockpicking, 3, TRUE)
belt = /obj/item/storage/belt/rogue/leather
pants = /obj/item/clothing/under/roguetown/trou/leather
shirt = /obj/item/clothing/suit/roguetown/shirt/shortshirt/random
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
owner.adjust_skillrank(/datum/skill/combat/knives, 6, TRUE)
owner.adjust_skillrank(/datum/skill/combat/wrestling, 5, TRUE)
owner.adjust_skillrank(/datum/skill/combat/unarmed, 4, TRUE)
owner.adjust_skillrank(/datum/skill/misc/lockpicking, 2, TRUE)
STASTR = dreamer.STASTR
STACON = dreamer.STACON
STAEND = dreamer.STAEND
Expand Down
5 changes: 5 additions & 0 deletions code/modules/cargo/packsrogue/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@
name = "Proesthetic Arm (R)"
cost = 40
contains = list(/obj/item/bodypart/r_arm/rproesthetic)

/datum/supply_pack/rogue/tools/lockpicks
name = "Lockpicks"
cost = 20
contains = /obj/item/lockpickring/mundane
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
H.mind.adjust_skillrank(/datum/skill/misc/sneaking, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/medicine, 1, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/lockpicking, 1, TRUE)
H.change_stat("strength", 2)
H.change_stat("intelligence", 2)
H.change_stat("endurance", 2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
H.mind.adjust_skillrank(/datum/skill/misc/athletics, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/reading, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/riding, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/lockpicking, 2, TRUE)
H.change_stat("strength", 2)
H.change_stat("perception", 3)
H.change_stat("intelligence", 3)
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
armor = /obj/item/clothing/suit/roguetown/armor/leather/vest/black
shirt = /obj/item/clothing/suit/roguetown/shirt/undershirt/random
backr = /obj/item/storage/backpack/rogue/satchel
backpack_contents = list(/obj/item/lockpick = 1)
belt = /obj/item/storage/belt/rogue/leather
backpack_contents = list(/obj/item/bait = 1)
gloves = /obj/item/clothing/gloves/roguetown/fingerless
Expand All @@ -45,6 +46,7 @@
H.mind.adjust_skillrank(/datum/skill/misc/reading, 3, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/swimming, 2, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/climbing, 4, TRUE)
H.mind.adjust_skillrank(/datum/skill/misc/lockpicking, 2, TRUE)
H.change_stat("strength", 1)
H.change_stat("perception", 1)
H.change_stat("intelligence", 1)
Expand Down
Loading

0 comments on commit 8f24c5e

Please sign in to comment.