diff --git a/code/__defines/crafting.dm b/code/__defines/crafting.dm index 583c5abe46..35e5b8f5fc 100644 --- a/code/__defines/crafting.dm +++ b/code/__defines/crafting.dm @@ -24,4 +24,5 @@ #define CAT_SPAGHETTI "Spaghettis" #define CAT_ICE "Frozen" #define CAT_DRINK "Drinks" -#define CAT_CHEMISTRY "Chemistry" \ No newline at end of file +#define CAT_CHEMISTRY "Chemistry" +#define CAT_STORAGE "Storage" \ No newline at end of file diff --git a/code/datums/components/crafting/recipes.dm b/code/datums/components/crafting/recipes.dm index 889b69a782..36dcaf29dd 100644 --- a/code/datums/components/crafting/recipes.dm +++ b/code/datums/components/crafting/recipes.dm @@ -45,7 +45,7 @@ /datum/crafting_recipe/proc/on_craft_completion(mob/user, atom/result) return -// Computes the total reagents volume +// Computes the total reagents volume /datum/crafting_recipe/proc/get_parts_reagents_volume() . = 0 for(var/list/L in parts) @@ -94,6 +94,39 @@ S.set_material(M.material.name) qdel(M) +/datum/crafting_recipe/shortbow + name = "Shortbow" + result = /obj/item/weapon/gun/launcher/crossbow/bow + reqs = list(list(/obj/item/stack/material/wood = 10), + list(/obj/item/stack/material/cloth = 5)) + time = 120 + category = CAT_WEAPONRY + subcategory = CAT_WEAPON + +/datum/crafting_recipe/arrow_sandstone + name = "Wood arrow (sandstone tip)" + result = /obj/item/weapon/arrow/wood + reqs = list(list(/obj/item/stack/material/wood = 2), + list(/obj/item/stack/material/sandstone = 2)) + time = 20 + category = CAT_WEAPONRY + subcategory = CAT_AMMO + +/datum/crafting_recipe/arrow_marble + name = "Wood arrow (marble tip)" + result = /obj/item/weapon/arrow/wood + reqs = list(list(/obj/item/stack/material/wood = 2), + list(/obj/item/stack/material/marble = 2)) + time = 20 + category = CAT_WEAPONRY + subcategory = CAT_AMMO + +/datum/crafting_recipe/quiver + name = "Arrow quiver" + result = /obj/item/weapon/storage/bag/quiver + reqs = list(list(/obj/item/stack/material/leather = 8)) + time = 60 + category = CAT_STORAGE /datum/crafting_recipe/material_armor name = "Material Armor Plate" diff --git a/code/game/objects/items/weapons/material/swords.dm b/code/game/objects/items/weapons/material/swords.dm index a486d321f7..2e7ff4e565 100644 --- a/code/game/objects/items/weapons/material/swords.dm +++ b/code/game/objects/items/weapons/material/swords.dm @@ -23,4 +23,58 @@ name = "katana" desc = "Woefully underpowered in D20. This one looks pretty sharp." icon_state = "katana" - slot_flags = SLOT_BELT | SLOT_BACK \ No newline at end of file + slot_flags = SLOT_BELT | SLOT_BACK + +/obj/item/weapon/material/sword/rapier + name = "rapier" + desc = "A slender, fancy and sharply pointed sword." + icon_state = "rapier" + item_state = "rapier" + slot_flags = SLOT_BELT + applies_material_colour = 0 + attack_verb = list("attacked", "stabbed", "prodded", "poked", "lunged") + edge = 0 //rapiers are pointy, but not cutty like other swords + +/obj/item/weapon/material/sword/longsword + name = "longsword" + desc = "A double-edged large blade." + icon_state = "longsword" + item_state = "longsword" + applies_material_colour = 0 + slot_flags = SLOT_BELT | SLOT_BACK + can_cleave = TRUE + +/obj/item/weapon/material/sword/sabre + name = "sabre" + desc = "A sharp curved sword, a favored weapon of pirates far in the past." + icon_state = "sabre" + item_state = "sabre" + applies_material_colour = 0 //messes up the hilt color otherwise + slot_flags = SLOT_BELT + +/obj/item/weapon/material/sword/battleaxe + name = "battleaxe" + desc = "A one handed battle axe, still a deadly weapon." + icon_state = "axe" + item_state = "axe" + slot_flags = SLOT_BACK + attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") + applies_material_colour = 0 + drop_sound = 'sound/items/drop/axe.ogg' + pickup_sound = 'sound/items/pickup/axe.ogg' + can_cleave = TRUE + +/obj/item/weapon/material/sword/battleaxe/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack") + if(unique_parry_check(user, attacker, damage_source) && prob(10)) + user.visible_message("\The [user] parries [attack_text] with \the [src]!") + playsound(src, 'sound/weapons/punchmiss.ogg', 50, 1) + return 1 + return 0 + +/obj/item/weapon/material/sword/gladius + name = "gladius" + desc = "An ancient short sword, designed to stab and cut." + icon_state = "gladius" + item_state = "gladius" + applies_material_colour = 0 + slot_flags = SLOT_BELT \ No newline at end of file diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 5ca8091ab6..2b3461d1d1 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -174,3 +174,60 @@ base_icon = "riding_crop" icon_state = "riding_crop0" attack_verb = list("cropped","spanked","swatted","smacked","peppered") + +/obj/item/weapon/material/twohanded/spear/pike + name = "pike" + icon_state = "pike0" + base_icon = "pike" + desc = "A long spear used by the infantry in ancient times." + edge = TRUE + attack_verb = list("attacked", "poked", "jabbed", "gored", "stabbed") + default_material = "steel" + applies_material_colour = 0 + drop_sound = 'sound/items/drop/woodweapon.ogg' + pickup_sound = 'sound/items/pickup/woodweapon.ogg' + +/obj/item/weapon/material/twohanded/spear/halberd + icon_state = "halberd0" + base_icon = "halberd" + name = "halberd" + desc = "A sharp axe mounted on the top of a long spear." + applies_material_colour = 0 + edge = 1 + attack_verb = list("attacked", "poked", "jabbed","gored", "chopped", "cleaved", "torn", "cut", "stabbed") + drop_sound = 'sound/items/drop/woodweapon.ogg' + pickup_sound = 'sound/items/pickup/woodweapon.ogg' + can_cleave = TRUE + + +/obj/item/weapon/material/twohanded/spear/pike/pitchfork + icon_state = "pitchfork0" + base_icon = "pitchfork" + name = "pitchfork" + desc = "An old farming tool, not something you would find at hydroponics." + applies_material_colour = 0 + +/obj/item/weapon/material/twohanded/zweihander + icon_state = "zweihander0" + base_icon = "zweihander" + name = "zweihander" + desc = "A german upgrade to the einhander models of ancient times." + force = 20 + w_class = ITEMSIZE_LARGE + slot_flags = SLOT_BACK + force_wielded = 30 + unwielded_force_divisor = 1 + thrown_force_divisor = 0.75 + edge = TRUE + sharp = 1 + edge = 1 + attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") + default_material = "steel" + can_cleave = TRUE + +/obj/item/weapon/material/twohanded/zweihander/handle_shield(mob/user, var/damage, atom/damage_source = null, mob/attacker = null, var/def_zone = null, var/attack_text = "the attack") + if(unique_parry_check(user, attacker, damage_source) && prob(10)) + user.visible_message("\The [user] parries [attack_text] with \the [src]!") + playsound(src, 'sound/weapons/punchmiss.ogg', 50, 1) + return 1 + return 0 diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 1b19bf7a20..4c2053fdf5 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -25,6 +25,8 @@ slot_flags = SLOT_BELT drop_sound = 'sound/items/drop/backpack.ogg' pickup_sound = 'sound/items/pickup/backpack.ogg' + sprite_sheets = list( + SPECIES_TESHARI = 'icons/mob/species/teshari/back.dmi') // ----------------------------- // Trash bag @@ -395,3 +397,17 @@ w_class = ITEMSIZE_SMALL can_hold = list(/obj/item/weapon/forensics/swab,/obj/item/weapon/sample/print,/obj/item/weapon/sample/fibers,/obj/item/weapon/evidencebag) + + // ----------------------------- + // Quiver (arrow bag) + // ----------------------------- +/obj/item/weapon/storage/bag/quiver + name = "quiver" + icon = 'icons/obj/storage.dmi' + icon_state = "quiver" + desc = "A quiver for storing arrows." + max_storage_space = 100 //holds 25 arrows + max_w_class = ITEMSIZE_NORMAL + w_class = ITEMSIZE_LARGE + slot_flags = SLOT_BACK + can_hold = list(/obj/item/weapon/arrow/wood) \ No newline at end of file diff --git a/code/modules/projectiles/guns/launcher/bows.dm b/code/modules/projectiles/guns/launcher/bows.dm new file mode 100644 index 0000000000..7de22cb799 --- /dev/null +++ b/code/modules/projectiles/guns/launcher/bows.dm @@ -0,0 +1,156 @@ +/obj/item/weapon/arrow/wood + name = "wooden arrow" + desc = "A wooden arrow with a stone tip. Simple, but gets the job done." + icon = 'icons/obj/weapons.dmi' + icon_state = "arrow" + item_state = "bolt" + throwforce = 7 + w_class = ITEMSIZE_NORMAL + sharp = 1 + edge = 0 + drop_sound = 'sound/items/drop/woodweapon.ogg' + pickup_sound = 'sound/items/pickup/woodweapon.ogg' + + +/obj/item/weapon/arrow/energy + name = "hardlight arrow" + desc = "An arrow made out of energy! Classic?" + icon = 'icons/obj/weapons.dmi' + icon_state = "hardlight" + item_state = "bolt" + throwforce = 6 + w_class = ITEMSIZE_NORMAL + sharp = 1 + edge = 1 + embed_chance = 0 + catchable = FALSE // no catching energy + +/obj/item/weapon/arrow/energy/throw_impact(atom/hit_atom) + . = ..() + qdel(src) + +/obj/item/weapon/arrow/energy/equipped() + if(isliving(loc)) + var/mob/living/L = loc + L.drop_from_inventory(src) + qdel(src) + +/obj/item/weapon/gun/launcher/crossbow/bow + name = "shortbow" + desc = "A common shortbow, capable of firing arrows at high speed towards a target. Useful for hunting while keeping quiet." + icon = 'icons/obj/weapons.dmi' + icon_state = "bow" + item_state = "bow" + fire_sound = 'sound/weapons/punchmiss.ogg' // TODO: Decent THWOK noise. + fire_sound_text = "a light swoosh of air" + fire_delay = 25 + slot_flags = SLOT_BACK + release_speed = 15 + release_force = 20 + tension = 3 + var/drawn = FALSE + drop_sound = 'sound/items/drop/woodweapon.ogg' + pickup_sound = 'sound/items/pickup/woodweapon.ogg' + + +/obj/item/weapon/gun/launcher/crossbow/bow/update_release_force(obj/item/projectile) + return 0 + +/obj/item/weapon/gun/launcher/crossbow/bow/proc/unload(mob/user) + var/obj/item/weapon/arrow/A = bolt + bolt = null + drawn = FALSE + A.forceMove(get_turf(user)) + user.put_in_hands(A) + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/consume_next_projectile(mob/user) + if(!drawn) + to_chat(user, "\The [src] is not drawn back!") + return null + return bolt + +/obj/item/weapon/gun/launcher/crossbow/bow/handle_post_fire(mob/user, atom/target) + bolt = null + drawn = FALSE + update_icon() + ..() + +/obj/item/weapon/gun/launcher/crossbow/bow/attack_hand(mob/living/user) + if(loc == user && bolt && !drawn) + user.visible_message("[user] removes [bolt] from [src].","You remove [bolt] from [src].") + unload(user) + else + return ..() + +/obj/item/weapon/gun/launcher/crossbow/bow/attack_self(mob/living/user) + if(drawn) + user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.") + drawn = FALSE + update_icon() + else + draw(user) + +/obj/item/weapon/gun/launcher/crossbow/bow/draw(var/mob/user) + if(!bolt) + to_chat(user, "You don't have anything nocked to [src].") + return + + if(user.restrained()) + return + + current_user = user + user.visible_message("[user] begins to draw back the string of [src].","You begin to draw back the string of [src].") + if(do_after(user, 25)) + drawn = TRUE + user.visible_message("[user] draws the string on [src] back fully!", "You draw the string on [src] back fully!") + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/handle_click_empty(mob/user) + return + +/obj/item/weapon/gun/launcher/crossbow/bow/attackby(obj/item/W as obj, mob/user) + if(!bolt && istype(W,/obj/item/weapon/arrow/wood)) + user.drop_from_inventory(W, src) + bolt = W + user.visible_message("[user] nocks [bolt] in [src].","You nock [bolt] in [src].") + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/update_icon() + if(drawn) + icon_state = "[initial(icon_state)]_firing" + else if(bolt) + icon_state = "[initial(icon_state)]_loaded" + else + icon_state = "[initial(icon_state)]" + +/obj/item/weapon/gun/launcher/crossbow/bow/dropped(mob/user) + if(drawn) + to_chat(user, "\The [src]'s tension is relaxed as you let go of it!") + drawn = FALSE + update_icon() + + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight + name = "hardlight bow" + icon_state = "bow_hardlight" + item_state = "bow_hardlight" + desc = "A modern twist on an ancient weapon, generating arrows from energy!" + drop_sound = 'sound/items/drop/gun.ogg' + pickup_sound = 'sound/items/pickup/gun.ogg' + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight/unload(mob/user) + qdel_null(bolt) + update_icon() + +/obj/item/weapon/gun/launcher/crossbow/bow/hardlight/attack_self(mob/living/user) + if(drawn) + user.visible_message("[user] relaxes the tension on [src]'s string.","You relax the tension on [src]'s string.") + drawn = FALSE + update_icon() + else if(!bolt) + user.visible_message("[user] fabricates a new hardlight projectile with [src].","You fabricate a new hardlight projectile with [src].") + bolt = new /obj/item/weapon/arrow/energy(src) + update_icon() + else + draw(user) \ No newline at end of file diff --git a/icons/mob/back.dmi b/icons/mob/back.dmi index 58cbf3f8fa..46a696e64f 100644 Binary files a/icons/mob/back.dmi and b/icons/mob/back.dmi differ diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi index 6d88803fcb..d469e94cd1 100644 Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ diff --git a/icons/mob/items/lefthand_guns.dmi b/icons/mob/items/lefthand_guns.dmi index a7360f8a34..904a70a4bd 100644 Binary files a/icons/mob/items/lefthand_guns.dmi and b/icons/mob/items/lefthand_guns.dmi differ diff --git a/icons/mob/items/lefthand_material.dmi b/icons/mob/items/lefthand_material.dmi index dec3ab84ea..c53503d35e 100644 Binary files a/icons/mob/items/lefthand_material.dmi and b/icons/mob/items/lefthand_material.dmi differ diff --git a/icons/mob/items/righthand_guns.dmi b/icons/mob/items/righthand_guns.dmi index 26e830efde..9fbef51dab 100644 Binary files a/icons/mob/items/righthand_guns.dmi and b/icons/mob/items/righthand_guns.dmi differ diff --git a/icons/mob/items/righthand_material.dmi b/icons/mob/items/righthand_material.dmi index d65181cc6a..6795871981 100644 Binary files a/icons/mob/items/righthand_material.dmi and b/icons/mob/items/righthand_material.dmi differ diff --git a/icons/mob/species/teshari/back.dmi b/icons/mob/species/teshari/back.dmi index cdf3c6e559..ac4a960009 100644 Binary files a/icons/mob/species/teshari/back.dmi and b/icons/mob/species/teshari/back.dmi differ diff --git a/icons/obj/storage.dmi b/icons/obj/storage.dmi index 81000e8221..55eee87e4b 100644 Binary files a/icons/obj/storage.dmi and b/icons/obj/storage.dmi differ diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi index 3967721435..ed3288816a 100644 Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ diff --git a/polaris.dme b/polaris.dme index 2e8b4f02e8..a5124565e3 100644 --- a/polaris.dme +++ b/polaris.dme @@ -2840,6 +2840,7 @@ #include "code\modules\projectiles\guns\energy\special.dm" #include "code\modules\projectiles\guns\energy\stun.dm" #include "code\modules\projectiles\guns\energy\temperature.dm" +#include "code\modules\projectiles\guns\launcher\bows.dm" #include "code\modules\projectiles\guns\launcher\crossbow.dm" #include "code\modules\projectiles\guns\launcher\grenade_launcher.dm" #include "code\modules\projectiles\guns\launcher\pneumatic.dm"