Convert sound data in entity templates

This was SVN commit r7436.
This commit is contained in:
Ykkrosh 2010-04-04 21:12:21 +00:00
parent 7a14a3ee90
commit 7275071785
10 changed files with 84 additions and 1 deletions

View File

@ -32,4 +32,10 @@
<Circle radius="1.2"/>
<Height>7.5</Height>
</Footprint>
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<death>actor/fauna/death/death_horse.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -30,4 +30,10 @@
<PrepareTime>900</PrepareTime>
<RepeatTime>1500</RepeatTime>
</Attack>
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<death>actor/human/death/death.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -31,4 +31,10 @@
<PrepareTime>600</PrepareTime>
<RepeatTime>1000</RepeatTime>
</Attack>
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<death>actor/fauna/death/death_horse.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -30,4 +30,10 @@
<PrepareTime>600</PrepareTime>
<RepeatTime>1000</RepeatTime>
</Attack>
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<death>actor/human/death/death.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -53,4 +53,18 @@
structures/{civ}_wall_tower
</Entities>
</Builder>
<Sound>
<SoundGroups>
<walk>actor/human/movement/walk.xml</walk>
<run>actor/human/movement/walk.xml</run>
<attack>attack/weapon/sword.xml</attack>
<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>
<gather_wood>resource/lumbering/lumbering.xml</gather_wood>
<gather_stone>resource/mining/pickaxe.xml</gather_stone>
<gather_metal>resource/mining/mining.xml</gather_metal>
</SoundGroups>
</Sound>
</Entity>

View File

@ -14,4 +14,9 @@
<PrepareTime>1200</PrepareTime>
<RepeatTime>2000</RepeatTime>
</Attack>
<Sound>
<SoundGroups>
<attack>attack/weapon/arrowfly.xml</attack>
</SoundGroups>
</Sound>
</Entity>

View File

@ -33,4 +33,9 @@
<Circle radius="1.2"/>
<Height>5.0</Height>
</Footprint>
<Sound>
<SoundGroups>
<death>actor/fauna/death/death_horse.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -33,4 +33,12 @@
<Circle radius="0.5"/>
<Height>2.5</Height>
</Footprint>
<Sound>
<SoundGroups>
<walk>actor/human/movement/walk.xml</walk>
<run>actor/human/movement/walk.xml</run>
<attack>attack/weapon/sword.xml</attack>
<death>actor/human/death/death.xml</death>
</SoundGroups>
</Sound>
</Entity>

View File

@ -47,4 +47,16 @@
structures/{civ}_temple
</Entities>
</Builder>
<Sound>
<SoundGroups>
<attack>attack/weapon/sword.xml</attack>
<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>
<gather_wood>resource/lumbering/lumbering.xml</gather_wood>
<gather_stone>resource/mining/pickaxe.xml</gather_stone>
<gather_metal>resource/mining/mining.xml</gather_metal>
</SoundGroups>
</Sound>
</Entity>

View File

@ -195,7 +195,7 @@ sub convert {
$out .= qq{$i$i<Circle radius="$data->{Traits}[0]{Footprint}[0]{Radius}[0]"/>\n};
}
if ($data->{Traits}[0]{Footprint}[0]{Width}) {
$out .= qq{$i$i<Square width="$data->{Traits}[0]{Footprint}[0]{Width}[0]" depth="$data->{Traits}[0]{Footprint}[0]{Depth}[0]"/>\n};
$out .= qq{$i$i<Square width="$data->{Traits}[0]{Footprint}[0]{Width}[0]" depth="$data->{Traits}[0]{Footprint}[0]{Depth}[0]"/>\n}; #"
}
if ($data->{Traits}[0]{Footprint}[0]{Height}) {
$out .= qq{$i$i<Height>$data->{Traits}[0]{Footprint}[0]{Height}[0]</Height>\n};
@ -223,6 +223,21 @@ sub convert {
$out .= qq{$i</Builder>\n};
}
if ($data->{SoundGroups}) {
$out .= qq{$i<Sound>\n};
$out .= qq{$i$i<SoundGroups>\n};
for my $n (qw(Walk Run Melee Death Build Gather_Fruit Gather_Grain Gather_Wood Gather_Stone Gather_Metal)) {
my $n2 = lc $n;
if ($n2 eq 'melee') { $n2 = 'attack'; }
if ($data->{SoundGroups}[0]{$n}) {
my $f = $data->{SoundGroups}[0]{$n}[0];
$f =~ s~^audio/~~ or die;
$out .= qq{$i$i$i<$n2>$f</$n2>\n};
}
}
$out .= qq{$i$i</SoundGroups>\n};
$out .= qq{$i</Sound>\n};
}
$out .= qq{</Entity>\n};
return $out;