-
-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
62 additions
and
89 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
...modules/projectiles/boxes_magazines/ammo_stacks/prefab_stacks/premade_shotshell_stacks.dm
This file contains 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
1 change: 1 addition & 0 deletions
1
code/modules/projectiles/boxes_magazines/ammo_stacks/prefab_stacks/premade_smg_stacks.dm
This file contains 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
104 changes: 52 additions & 52 deletions
104
code/modules/projectiles/boxes_magazines/generic_ammo_box.dm
This file contains 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 |
---|---|---|
@@ -1,53 +1,53 @@ | ||
/obj/item/ammo_box/generic | ||
name = "generic ammo box" | ||
desc = "A generic, unbranded box of ammo. It doesn't have great capacity, but it can hold a variety of different calibers." | ||
max_ammo = 20 | ||
start_empty = TRUE | ||
icon_state = "generic-ammo" | ||
/// Does the box currently have an ammo type set? | ||
var/ammo_set = FALSE | ||
/// Name of the currently set ammo type | ||
var/ammo_name | ||
|
||
/obj/item/ammo_box/generic/update_ammo_count() | ||
. = ..() | ||
if(LAZYLEN(stored_ammo) == 0) | ||
ammo_set = FALSE | ||
ammo_type = /obj/item/ammo_casing | ||
|
||
/obj/item/ammo_box/generic/proc/update_max_ammo(obj/item/ammo_casing/ammo) | ||
if(ammo.bullet_per_box) | ||
max_ammo = round(ammo.bullet_per_box) | ||
else | ||
max_ammo = 10 | ||
|
||
return | ||
|
||
/obj/item/ammo_box/generic/attackby(obj/item/attacking_obj, mob/user, params, silent, replace_spent) | ||
. = ..() | ||
|
||
if(!ammo_set && istype(attacking_obj, /obj/item/ammo_casing)) | ||
var/obj/item/ammo_casing/ammo_load = attacking_obj.type | ||
ammo_type = ammo_load | ||
ammo_set = TRUE | ||
ammo_name = attacking_obj.name | ||
update_max_ammo(attacking_obj) | ||
to_chat(user, span_notice("You set the box to hold [attacking_obj]!")) | ||
|
||
if(istype(attacking_obj, /obj/item/pen)) | ||
if(!user.is_literate()) | ||
to_chat(user, span_notice("You scribble illegibly on the cover of [src]!")) | ||
return | ||
var/inputvalue = stripped_input(user, "What would you like to label the box?", "Box Labelling", "", MAX_NAME_LEN) | ||
|
||
if(!inputvalue) | ||
return | ||
|
||
if(user.canUseTopic(src, BE_CLOSE)) | ||
name = "[initial(src.name)][(inputvalue ? " - '[inputvalue]'" : null)]" | ||
|
||
/obj/item/ammo_box/generic/examine(mob/user) | ||
. = ..() | ||
. += span_notice("[ammo_set ? "It's set to hold [ammo_name]\s. The box can hold up to [max_ammo] rounds." : "It doesn't have an ammo type set. Use a bullet on the box to set it."]") | ||
. += span_notice("You can use a pen on it to rename the box.") | ||
// /obj/item/ammo_box/generic | ||
// name = "generic ammo box" | ||
// desc = "A generic, unbranded box of ammo. It doesn't have great capacity, but it can hold a variety of different calibers." | ||
// max_ammo = 20 | ||
// start_empty = TRUE | ||
// icon_state = "generic-ammo" | ||
// /// Does the box currently have an ammo type set? | ||
// var/ammo_set = FALSE | ||
// /// Name of the currently set ammo type | ||
// var/ammo_name | ||
|
||
// /obj/item/ammo_box/generic/update_ammo_count() | ||
// . = ..() | ||
// if(LAZYLEN(stored_ammo) == 0) | ||
// ammo_set = FALSE | ||
// ammo_type = /obj/item/ammo_casing | ||
|
||
// /obj/item/ammo_box/generic/proc/update_max_ammo(obj/item/ammo_casing/ammo) | ||
// if(ammo.bullet_per_box) | ||
// max_ammo = round(ammo.bullet_per_box) | ||
// else | ||
// max_ammo = 10 | ||
|
||
// return | ||
|
||
// /obj/item/ammo_box/generic/attackby(obj/item/attacking_obj, mob/user, params, silent, replace_spent) | ||
// . = ..() | ||
|
||
// if(!ammo_set && istype(attacking_obj, /obj/item/ammo_casing)) | ||
// var/obj/item/ammo_casing/ammo_load = attacking_obj.type | ||
// ammo_type = ammo_load | ||
// ammo_set = TRUE | ||
// ammo_name = attacking_obj.name | ||
// update_max_ammo(attacking_obj) | ||
// to_chat(user, span_notice("You set the box to hold [attacking_obj]!")) | ||
|
||
// if(istype(attacking_obj, /obj/item/pen)) | ||
// if(!user.is_literate()) | ||
// to_chat(user, span_notice("You scribble illegibly on the cover of [src]!")) | ||
// return | ||
// var/inputvalue = stripped_input(user, "What would you like to label the box?", "Box Labelling", "", MAX_NAME_LEN) | ||
|
||
// if(!inputvalue) | ||
// return | ||
|
||
// if(user.canUseTopic(src, BE_CLOSE)) | ||
// name = "[initial(src.name)][(inputvalue ? " - '[inputvalue]'" : null)]" | ||
|
||
// /obj/item/ammo_box/generic/examine(mob/user) | ||
// . = ..() | ||
// . += span_notice("[ammo_set ? "It's set to hold [ammo_name]\s. The box can hold up to [max_ammo] rounds." : "It doesn't have an ammo type set. Use a bullet on the box to set it."]") | ||
// . += span_notice("You can use a pen on it to rename the box.") | ||
|
This file contains 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