-
Notifications
You must be signed in to change notification settings - Fork 107
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
1 parent
13bddd8
commit 84e518f
Showing
8 changed files
with
269 additions
and
112 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/obj/structure/gun_rack | ||
name = "gun rack" | ||
desc = "ARMAT-produced gun rack for storage of long guns. While initial model was supposed to be extremely modifiable, USCM comissioned racks with fixed slots which only fit M41A rifles. Some say they were cheaper, and some say the main reason was marine's ability to easily break anything more complex than a tungsten ball." | ||
icon = 'icons/obj/structures/gun_racks.dmi' | ||
icon_state = "m41a" | ||
density = TRUE | ||
var/allowed_type | ||
var/max_stored = 5 | ||
var/initial_stored = 5 | ||
|
||
/obj/structure/gun_rack/Initialize() | ||
. = ..() | ||
if(!allowed_type) | ||
icon_state = "m41a_0" | ||
return | ||
|
||
if(initial_stored) | ||
var/i = 0 | ||
while(i < initial_stored) | ||
contents += new allowed_type(src) | ||
i++ | ||
update_icon() | ||
|
||
/obj/structure/gun_rack/attackby(obj/item/O, mob/user) | ||
if(istype(O, allowed_type) && contents.len < max_stored) | ||
user.drop_inv_item_to_loc(O, src) | ||
contents += O | ||
update_icon() | ||
|
||
/obj/structure/gun_rack/attack_hand(mob/living/user) | ||
if(!contents.len) | ||
to_chat(user, SPAN_WARNING("[src] is empty.")) | ||
return | ||
|
||
var/obj/stored_obj = contents[contents.len] | ||
contents -= stored_obj | ||
user.put_in_hands(stored_obj) | ||
to_chat(user, SPAN_NOTICE("You grab [stored_obj] from [src].")) | ||
playsound(src, "gunequip", 25, TRUE) | ||
update_icon() | ||
|
||
/obj/structure/gun_rack/update_icon() | ||
if(contents.len) | ||
icon_state = "[initial(icon_state)]_[contents.len]" | ||
else | ||
icon_state = "[initial(icon_state)]_0" | ||
|
||
/obj/structure/gun_rack/m41 | ||
allowed_type = /obj/item/weapon/gun/rifle/m41aMK1 | ||
|
||
/obj/structure/gun_rack/type71 | ||
icon_state = "type71" | ||
desc = "Some off-branded gun rack. Per SOF and UPPA regulations, weapons should be stored in secure safes and only given out when necessary. Of course, most (but not all!) units overlook this regulation, only storing their firearms in safes when inspection arrives." | ||
max_stored = 6 | ||
initial_stored = 6 | ||
allowed_type = /obj/item/weapon/gun/rifle/type71 |
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
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.