1
0
forked from 0ad/0ad

# Use more sound effects

This was SVN commit r7891.
This commit is contained in:
Ykkrosh 2010-08-10 01:25:24 +00:00
parent d1bc05f399
commit e6c3f1c482
15 changed files with 102 additions and 7 deletions

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Pitch>1</Pitch>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<ConeInner>360</ConeInner>
<ConeOuter>360</ConeOuter>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<GainUpper>1</GainUpper>
<GainLower>0.8</GainLower>
<RandPitch>1</RandPitch>
<PitchUpper>1.1</PitchUpper>
<PitchLower>0.9</PitchLower>
<Threshold>1</Threshold>
<Decay>3</Decay>
<Replacement>explode_debris_20.ogg</Replacement>
<Path>audio/attack/destruction/</Path>
<Sound>explode_debris_20.ogg</Sound>
</SoundGroup>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<SoundGroup>
<Gain>1</Gain>
<Pitch>1</Pitch>
<Priority>100</Priority>
<ConeGain>1</ConeGain>
<ConeInner>360</ConeInner>
<ConeOuter>360</ConeOuter>
<Looping>0</Looping>
<RandOrder>1</RandOrder>
<RandGain>1</RandGain>
<GainUpper>1</GainUpper>
<GainLower>0.8</GainLower>
<RandPitch>1</RandPitch>
<PitchUpper>1.1</PitchUpper>
<PitchLower>0.9</PitchLower>
<Threshold>1</Threshold>
<Decay>3</Decay>
<Replacement>arrowimpmetal_21.ogg</Replacement>
<Path>audio/attack/impact/</Path>
<Sound>arrowimpmetal_21.ogg</Sound>
<Sound>arrowimpmetal_22.ogg</Sound>
<Sound>arrowimpmetal_23.ogg</Sound>
<Sound>arrowimpmetal_24.ogg</Sound>
<Sound>arrowimpmetal_25.ogg</Sound>
<Sound>arrowimpmetal_26.ogg</Sound>
<Sound>arrowimpmetal_27.ogg</Sound>
<Sound>arrowimpmetal_28.ogg</Sound>
<Sound>arrowimpmetal_29.ogg</Sound>
<Sound>arrowimpmetal_210.ogg</Sound>
<Sound>arrowimpmetal_211.ogg</Sound>
<Sound>arrowimpmetal_212.ogg</Sound>
<Sound>arrowimpmetal_213.ogg</Sound>
</SoundGroup>

View File

@ -10,6 +10,11 @@ function _setMotionOverlay(ents, enabled)
Engine.GuiInterfaceCall("SetMotionDebugOverlay", { "entities":ents, "enabled":enabled });
}
function _playSound(ent)
{
Engine.GuiInterfaceCall("PlaySound", { "name":"select", "entity":ent });
}
//-------------------------------- -------------------------------- --------------------------------
// EntitySelection class for managing the entity selection list and the primary selection
//-------------------------------- -------------------------------- --------------------------------
@ -122,6 +127,8 @@ EntitySelection.prototype.addList = function(ents)
}
_setHighlight(added, 1);
_setMotionOverlay(added, this.motionDebugOverlay);
if (added.length)
_playSound(added[0]);
this.dirty = true;
};

View File

@ -216,6 +216,8 @@ Attack.prototype.CauseDamage = function(data)
Engine.PostMessage(data.target, MT_Attacked,
{ "attacker": this.entity, "target": data.target });
PlaySound("attack_impact", this.entity);
};
Engine.RegisterComponentType(IID_Attack, "Attack", Attack);

View File

@ -328,6 +328,11 @@ GuiInterface.prototype.SetBuildingPlacementPreview = function(player, cmd)
return false;
};
GuiInterface.prototype.PlaySound = function(player, data)
{
PlaySound(data.name, data.entity);
};
GuiInterface.prototype.SetPathfinderDebugOverlay = function(player, enabled)
{
var cmpPathfinder = Engine.QueryInterface(SYSTEM_ENTITY, IID_Pathfinder);
@ -365,13 +370,16 @@ var exposedFunctions = {
"GetSimulationState": 1,
"GetEntityState": 1,
"GetTemplateData": 1,
"SetSelectionHighlight": 1,
"DisplayRallyPoint": 1,
"SetBuildingPlacementPreview": 1,
"PlaySound": 1,
"SetPathfinderDebugOverlay": 1,
"SetObstructionDebugOverlay": 1,
"SetMotionDebugOverlay": 1,
"SetRangeDebugOverlay": 1,
"DisplayRallyPoint": 1
"SetRangeDebugOverlay": 1
};
GuiInterface.prototype.ScriptCall = function(player, name, args)

View File

@ -189,6 +189,10 @@ TrainingQueue.prototype.SpawnUnits = function(templateName, count)
if (rallyPos)
cmpUnitAI.Walk(rallyPos.x, rallyPos.z, false);
}
// Play a sound, but only for the first in the batch (to avoid nasty phasing effects)
if (i == 0)
PlaySound("trained", ent);
}
};

View File

@ -142,7 +142,6 @@ var UnitFsmSpec = {
"APPROACHING": {
"enter": function() {
this.SelectAnimation("walk", false, this.GetWalkSpeed());
this.PlaySound("walk");
},
"MoveStopped": function() {
@ -199,7 +198,6 @@ var UnitFsmSpec = {
"CHASING": {
"enter": function() {
this.SelectAnimation("walk", false, this.GetWalkSpeed());
this.PlaySound("walk");
},
"MoveStopped": function() {

View File

@ -32,6 +32,7 @@
<Sound>
<SoundGroups>
<panic>actor/fauna/animal/chickens.xml</panic>
<select>actor/fauna/animal/chickens.xml</select>
</SoundGroups>
</Sound>
</Entity>

View File

@ -43,4 +43,10 @@
<RetainInFog>true</RetainInFog>
</Vision>
<RallyPoint/>
<Sound>
<SoundGroups>
<select>interface/select/building/sel_universal.xml</select>
<death>attack/destruction/explode_debris.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -65,6 +65,7 @@
<run>actor/mounted/movement/walk.xml</run>
<attack>attack/weapon/sword.xml</attack>
<death>actor/fauna/death/death_horse.xml</death>
<trained>interface/alarm/alarm_create_cav.xml</trained>
</SoundGroups>
</Sound>
</Entity>

View File

@ -92,6 +92,7 @@
<gather_wood>resource/lumbering/lumbering.xml</gather_wood>
<gather_stone>resource/mining/pickaxe.xml</gather_stone>
<gather_metal>resource/mining/mining.xml</gather_metal>
<trained>interface/alarm/alarm_create_infantry.xml</trained>
</SoundGroups>
</Sound>
</Entity>

View File

@ -19,4 +19,9 @@
<RepeatTime>2000</RepeatTime>
</Ranged>
</Attack>
<Sound>
<SoundGroups>
<attack_impact>attack/impact/arrow_metal.xml</attack_impact>
</SoundGroups>
</Sound>
</Entity>

View File

@ -19,4 +19,9 @@
<Health>
<RegenRate>0.2</RegenRate>
</Health>
<Sound>
<SoundGroups>
<trained>interface/alarm/alarm_create_worker.xml</trained>
</SoundGroups>
</Sound>
</Entity>

View File

@ -23,8 +23,8 @@
<food.meat>4</food.meat>
<wood.tree>.75</wood.tree>
<stone.rock>.75</stone.rock>
<metal.ore>.75</metal.ore>
<metal.treasure>10000</metal.treasure>
<metal.ore>.75</metal.ore>
<metal.treasure>10000</metal.treasure>
</Rates>
</ResourceGatherer>
<Health>
@ -75,7 +75,7 @@
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<death>actor/human/death/death.xml</death>
<!-- <death>actor/human/death/death.xml</death> -->
<build>resource/construction/con_wood.xml</build>
<gather_fruit>resource/foraging/forage_leaves.xml</gather_fruit>
<gather_grain>resource/farming/farm.xml</gather_grain>

View File

@ -458,6 +458,7 @@ void CCmpTemplateManager::CopyFoundationSubset(CParamNode& out, const CParamNode
permittedComponentTypes.insert("Health");
permittedComponentTypes.insert("Decay");
permittedComponentTypes.insert("Cost");
permittedComponentTypes.insert("Sound");
CParamNode::LoadXMLString(out, "<Entity/>");
out.CopyFilteredChildrenOfChild(in, "Entity", permittedComponentTypes);