From 54900f339c7631500c1049f7f81acd36f3c6871c Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Thu, 22 Apr 2010 23:37:14 +0000
Subject: [PATCH] melee sound

git-svn-id: http://svn.net-core.org/repos/t-engine4@550 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua                   | 3 ++-
 game/modules/tome/class/interface/Combat.lua        | 4 ++--
 game/modules/tome/data/general/objects/2haxes.lua   | 3 +--
 game/modules/tome/data/general/objects/2hmaces.lua  | 3 +--
 game/modules/tome/data/general/objects/2hswords.lua | 3 +--
 game/modules/tome/data/general/objects/axes.lua     | 3 +--
 game/modules/tome/data/general/objects/bows.lua     | 3 +--
 game/modules/tome/data/general/objects/knifes.lua   | 3 +--
 game/modules/tome/data/general/objects/maces.lua    | 3 +--
 game/modules/tome/data/general/objects/slings.lua   | 3 +--
 game/modules/tome/data/general/objects/swords.lua   | 3 +--
 game/modules/tome/data/sound/actions/melee.lua      | 4 ++++
 game/modules/tome/data/sound/actions/melee_miss.lua | 4 ++++
 13 files changed, 21 insertions(+), 21 deletions(-)
 create mode 100644 game/modules/tome/data/sound/actions/melee.lua
 create mode 100644 game/modules/tome/data/sound/actions/melee_miss.lua

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index f4776d224f..1fe81183da 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -276,7 +276,8 @@ function _M:TextSizeCategory()
 	elseif self.size_category == 2 then sizecat = "small"
 	elseif self.size_category == 3 then sizecat = "medium"
 	elseif self.size_category == 4 then sizecat = "big"
-	elseif self.size_category >= 5 then sizecat = "huge"
+	elseif self.size_category == 5 then sizecat = "huge"
+	elseif self.size_category >= 6 then sizecat = "gargantuan"
 	end
 	return sizecat
 end
diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index 6d06d6b046..afa460c5dc 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -203,8 +203,8 @@ function _M:archeryShoot(damtype, mult, on_hit, tg, params)
 		end
 	end)
 
-	if ret.hitted and not sound then sound = realweapon.sound
-	elseif not ret.hitted and not sound_miss then sound_miss = realweapon.sound_miss end
+	if ret.hitted and not sound then sound = weapon.sound
+	elseif not ret.hitted and not sound_miss then sound_miss = weapon.sound_miss end
 
 	print("[SHOOT] speed", ret.speed or 1, "=>", game.energy_to_act * (ret.speed or 1))
 	self:useEnergy(game.energy_to_act * (ret.speed or 1))
diff --git a/game/modules/tome/data/general/objects/2haxes.lua b/game/modules/tome/data/general/objects/2haxes.lua
index f9c80f3dde..9718a5fe50 100644
--- a/game/modules/tome/data/general/objects/2haxes.lua
+++ b/game/modules/tome/data/general/objects/2haxes.lua
@@ -24,10 +24,9 @@ newEntity{
 	type = "weapon", subtype="battleaxe",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 3,
 	rarity = 5,
-	combat = { talented = "axe", damrange = 1.5 },
+	combat = { talented = "axe", damrange = 1.5, sound = "actions/melee", sound_miss = "actions/melee_miss", },
 	desc = [[Massive two-handed battleaxes.]],
 	twohanded = true,
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
diff --git a/game/modules/tome/data/general/objects/2hmaces.lua b/game/modules/tome/data/general/objects/2hmaces.lua
index 7960cf9aef..02abfef300 100644
--- a/game/modules/tome/data/general/objects/2hmaces.lua
+++ b/game/modules/tome/data/general/objects/2hmaces.lua
@@ -24,10 +24,9 @@ newEntity{
 	type = "weapon", subtype="greatmaul",
 	add_name = " (#COMBAT#)",
 	display = "\\", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 5,
 	rarity = 5,
-	combat = { talented = "mace", damrange = 1.5, physspeed=1.2 },
+	combat = { talented = "mace", damrange = 1.5, physspeed=1.2, sound = "actions/melee", sound_miss = "actions/melee_miss", },
 	desc = [[Massive two-handed maul.]],
 	twohanded = true,
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
diff --git a/game/modules/tome/data/general/objects/2hswords.lua b/game/modules/tome/data/general/objects/2hswords.lua
index fe82dcfe6d..2440c228e6 100644
--- a/game/modules/tome/data/general/objects/2hswords.lua
+++ b/game/modules/tome/data/general/objects/2hswords.lua
@@ -24,10 +24,9 @@ newEntity{
 	type = "weapon", subtype="greatsword",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 3,
 	rarity = 5,
-	combat = { talented = "sword", damrange = 1.6 },
+	combat = { talented = "sword", damrange = 1.6, sound = "actions/melee", sound_miss = "actions/melee_miss", },
 	desc = [[Massive two-handed swords.]],
 	twohanded = true,
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
diff --git a/game/modules/tome/data/general/objects/axes.lua b/game/modules/tome/data/general/objects/axes.lua
index e53b8157d4..d27e1966c9 100644
--- a/game/modules/tome/data/general/objects/axes.lua
+++ b/game/modules/tome/data/general/objects/axes.lua
@@ -23,10 +23,9 @@ newEntity{
 	type = "weapon", subtype="waraxe",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 3,
 	rarity = 3,
-	combat = { talented = "axe", damrange = 1.4},
+	combat = { talented = "axe", damrange = 1.4, sound = "actions/melee", sound_miss = "actions/melee_miss",},
 	desc = [[One-handed war axes.]],
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
 }
diff --git a/game/modules/tome/data/general/objects/bows.lua b/game/modules/tome/data/general/objects/bows.lua
index d137587005..e4d612640d 100644
--- a/game/modules/tome/data/general/objects/bows.lua
+++ b/game/modules/tome/data/general/objects/bows.lua
@@ -23,10 +23,9 @@ newEntity{
 	slot_forbid = "OFFHAND",
 	type = "weapon", subtype="longbow",
 	display = "}", color=colors.UMBER,
-	sound = "actions/arrow", sound_miss = "actions/arrow",
 	encumber = 4,
 	rarity = 5,
-	combat = { talented = "bow", damrange = 1.4},
+	combat = { talented = "bow", damrange = 1.4, sound = "actions/arrow", sound_miss = "actions/arrow",},
 	archery = "bow",
 	desc = [[Longbows are used to shoot arrows at your foes.]],
 }
diff --git a/game/modules/tome/data/general/objects/knifes.lua b/game/modules/tome/data/general/objects/knifes.lua
index 33ddb83f8e..161ca434fb 100644
--- a/game/modules/tome/data/general/objects/knifes.lua
+++ b/game/modules/tome/data/general/objects/knifes.lua
@@ -23,10 +23,9 @@ newEntity{
 	type = "weapon", subtype="dagger",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.WHITE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 1,
 	rarity = 5,
-	combat = { talented = "knife", damrange = 1.3 },
+	combat = { talented = "knife", damrange = 1.3, sound = "actions/melee", sound_miss = "actions/melee_miss", },
 	desc = [[Sharp, long, and deadly.]],
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
 }
diff --git a/game/modules/tome/data/general/objects/maces.lua b/game/modules/tome/data/general/objects/maces.lua
index ca52cb5507..eae2f746bd 100644
--- a/game/modules/tome/data/general/objects/maces.lua
+++ b/game/modules/tome/data/general/objects/maces.lua
@@ -23,10 +23,9 @@ newEntity{
 	type = "weapon", subtype="mace",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 3,
 	rarity = 5,
-	combat = { talented = "mace", damrange = 1.4},
+	combat = { talented = "mace", damrange = 1.4, sound = "actions/melee", sound_miss = "actions/melee_miss",},
 	desc = [[Blunt and deadly.]],
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
 }
diff --git a/game/modules/tome/data/general/objects/slings.lua b/game/modules/tome/data/general/objects/slings.lua
index 75292ed8b6..9fca9a50bb 100644
--- a/game/modules/tome/data/general/objects/slings.lua
+++ b/game/modules/tome/data/general/objects/slings.lua
@@ -22,10 +22,9 @@ newEntity{
 	slot = "MAINHAND",
 	type = "weapon", subtype="sling",
 	display = "}", color=colors.UMBER,
-	sound = "actions/arrow", sound_miss = "actions/arrow",
 	encumber = 4,
 	rarity = 5,
-	combat = { talented = "sling", },
+	combat = { talented = "sling", sound = "actions/arrow", sound_miss = "actions/arrow", },
 	archery = "sling",
 	desc = [[Slings are used to shoot peebles at your foes.]],
 }
diff --git a/game/modules/tome/data/general/objects/swords.lua b/game/modules/tome/data/general/objects/swords.lua
index d4f76005bc..d9dd1315df 100644
--- a/game/modules/tome/data/general/objects/swords.lua
+++ b/game/modules/tome/data/general/objects/swords.lua
@@ -23,10 +23,9 @@ newEntity{
 	type = "weapon", subtype="longsword",
 	add_name = " (#COMBAT#)",
 	display = "/", color=colors.SLATE,
-	sound = "actions/melee", sound_miss = "actions/melee_miss",
 	encumber = 3,
 	rarity = 5,
-	combat = { talented = "sword", damrange = 1.4},
+	combat = { talented = "sword", damrange = 1.4, sound = "actions/melee", sound_miss = "actions/melee_miss",},
 	desc = [[Sharp, long, and deadly.]],
 	egos = "/data/general/objects/egos/weapon.lua", egos_chance = resolvers.mbonus(40, 5),
 }
diff --git a/game/modules/tome/data/sound/actions/melee.lua b/game/modules/tome/data/sound/actions/melee.lua
new file mode 100644
index 0000000000..44dfe2b2e2
--- /dev/null
+++ b/game/modules/tome/data/sound/actions/melee.lua
@@ -0,0 +1,4 @@
+return {
+	file = "actions/melee.wav",
+	volume = 30,
+}
diff --git a/game/modules/tome/data/sound/actions/melee_miss.lua b/game/modules/tome/data/sound/actions/melee_miss.lua
new file mode 100644
index 0000000000..9c6d62483d
--- /dev/null
+++ b/game/modules/tome/data/sound/actions/melee_miss.lua
@@ -0,0 +1,4 @@
+return {
+	file = "actions/melee_miss.wav",
+	volume = 30,
+}
-- 
GitLab