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

Allows for sabre renaming. #20367

Merged
merged 5 commits into from Sep 12, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions code/game/objects/items/weapons/melee/misc.dm
@@ -1,6 +1,30 @@
/obj/item/weapon/melee
needs_permit = 1

<<<<<<< HEAD
=======
var/unique_rename = 0 //allows renaming with a pen

/obj/item/weapon/melee/examine(mob/user)
..()
if(unique_rename)
user << "<span class='notice'>Use a pen on it to rename it.</span>"

/obj/item/weapon/melee/attackby(obj/item/I, mob/user, params)
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
rename_weapon(user)
..()

/obj/item/weapon/melee/proc/rename_weapon(mob/M)
var/input = stripped_input(M,"What do you want to name the weapon?", ,"", MAX_NAME_LEN)

if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
M << "You name the weapon [input]. Say hello to your new friend."
return
>>>>>>> 04bb24d27a666b5821c9c053014095c032095f9d
Copy link
Contributor

Choose a reason for hiding this comment

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

Uh ohhh spaghettio


Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving merge conflict markers in

/obj/item/weapon/melee/chainofcommand
name = "chain of command"
desc = "A tool used by great men to placate the frothing masses."
Expand All @@ -27,6 +51,7 @@
icon_state = "sabre"
item_state = "sabre"
flags = CONDUCT
unique_rename = 1
force = 15
throwforce = 10
w_class = 4
Expand Down
25 changes: 25 additions & 0 deletions code/game/objects/items/weapons/weaponry.dm
@@ -1,3 +1,28 @@
/obj/item/weapon

var/unique_rename = 0 //allows renaming with a pen

/obj/item/weapon/examine(mob/user)
..()
if(unique_rename)
user << "<span class='notice'>Use a pen on it to rename it.</span>"

/obj/item/weapon/attackby(obj/item/I, mob/user, params)
if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
rename_weapon(user)
..()

/obj/item/weapon/proc/rename_weapon(mob/M)
var/input = stripped_input(M,"What do you want to name the weapon?", ,"", MAX_NAME_LEN)

if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
M << "You name the weapon [input]. Say hello to your new friend."
return



/obj/item/weapon/banhammer
desc = "A banhammer"
name = "banhammer"
Expand Down
18 changes: 2 additions & 16 deletions code/modules/projectiles/gun.dm
Expand Up @@ -14,6 +14,7 @@
force = 5
origin_tech = "combat=1"
needs_permit = 1
unique_rename = 0
attack_verb = list("struck", "hit", "bashed")

var/fire_sound = "gunshot"
Expand All @@ -31,11 +32,8 @@
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
var/semicd = 0 //cooldown handler
var/weapon_weight = WEAPON_LIGHT

var/spread = 0 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.

var/unique_rename = 0 //allows renaming with a pen
var/unique_reskin = 0 //allows one-time reskinning
var/current_skin = null //the skin choice if we had a reskin
var/list/options = list()
Expand Down Expand Up @@ -90,8 +88,6 @@
user << "It doesn't have a firing pin installed, and won't fire."
if(unique_reskin && !current_skin)
user << "<span class='notice'>Alt-click it to reskin it.</span>"
if(unique_rename)
user << "<span class='notice'>Use a pen on it to rename it.</span>"


/obj/item/weapon/gun/proc/process_chamber()
Expand Down Expand Up @@ -305,10 +301,7 @@ obj/item/weapon/gun/proc/newshot()
for(var/datum/action/item_action/toggle_gunlight/TGL in actions)
qdel(TGL)

if(unique_rename)
if(istype(I, /obj/item/weapon/pen))
rename_gun(user)
..()


/obj/item/weapon/gun/proc/toggle_gunlight()
set name = "Toggle Gunlight"
Expand Down Expand Up @@ -389,13 +382,6 @@ obj/item/weapon/gun/proc/newshot()
update_icon()


/obj/item/weapon/gun/proc/rename_gun(mob/M)
var/input = stripped_input(M,"What do you want to name the gun?", ,"", MAX_NAME_LEN)

if(src && input && !M.stat && in_range(M,src) && !M.restrained() && M.canmove)
name = input
M << "You name the gun [input]. Say hello to your new friend."
return


/obj/item/weapon/gun/proc/handle_suicide(mob/living/carbon/human/user, mob/living/carbon/human/target, params)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/projectile/revolver.dm
Expand Up @@ -37,7 +37,7 @@

if(unique_rename)
if(istype(A, /obj/item/weapon/pen))
rename_gun(user)
rename_weapon(user)

/obj/item/weapon/gun/projectile/revolver/attack_self(mob/living/user)
var/num_unloaded = 0
Expand Down