diff --git a/resources/resources.json b/resources/resources.json index 30b28c9..629c0c7 100644 --- a/resources/resources.json +++ b/resources/resources.json @@ -1,6 +1,97 @@ { + "spells": { + "bless": "bless.png", + "bone_golem": "bone_golem.png", + "chains_of_dread": "chains_of_dread.png", + "concealment": "concealment.png", + "curse": "curse.png", + "eagle_eye": "eagle_eye.png", + "fire_golem": "fire_golem.png", + "living_armor": "living_armor.png", + "meteor_shower": "meteor_shower.png", + "plague": "plague.png", + "rust": "rust.png", + "skeletion": "skeletion.png", + "speed": "speed.png", + "stone_golem": "stone_golem.png", + "strength": "strength.png", + "true_healing": "true_healing.png", + "weaken": "weaken.png" + }, "sounds": { - "click": "click.wav" + "click": "click.wav", + "heal": "heal.wav", + "critical_attack": "critical_attack.wav", + "settlement": "settlement.wav", + "gold": "coin.wav", + "mana": "mana.wav", + "revive": "revive.wav", + "dismiss": "dismiss.wav", + "spellbook": "spellbook.mp3", + "prepare_magic": "prepare_magic.wav", + "exit": "exit.wav", + "use_orb": "use_orb.ogg", + "imp_hit": "imp_hit.ogg", + "goblin_hit": "goblin_hit.wav", + "raise_dead": "raise_dead.wav", + "zombie_hit": "zombie_hit.ogg", + "lizardman_hit": "lizardman_hit.wav", + "explosion": "explosion.wav", + "rust": "rust.wav", + "flask_shatter": "flask_shatter.wav", + "loot": "loot.wav", + "step": "step.wav", + "battle_win": "himwar.wav", + "new_day": "day.ogg", + "new_level": "level.wav", + "battle_round": "war.wav", + "sword_attack": "sword_attack.wav", + "axe_attack": "axe_attack.wav", + "staff_attack": "staff_attack.wav", + "bow_attack": "bow_attack.wav", + "spear_attack": "spear_attack.wav", + "dagger_attack": "dagger_attack.wav", + "club_attack": "club_attack.wav", + "block": "block.wav", + "miss": "miss.ogg", + "nosferat_attack": "nosferat_attack.mp3", + "lich_queen_attack": "lich_queen_attack.mp3", + "hum_hit": "hum_hit.wav", + "hum_death": "hum_death.ogg", + "goblin_death": "goblin_death.wav", + "skeleton_hit": "skeleton_hit.wav", + "skeleton_death": "skeleton_death.wav", + "orc_hit": "orc_hit.ogg", + "orc_death": "orc_death.ogg", + "wolf_hit": "wolf_hit.wav", + "wolf_death": "wolf_death.wav", + "wolf_attack": "wolf_attack.wav", + "bear_hit": "bear_hit.wav", + "bear_death": "bear_death.wav", + "bear_attack": "bear_attack.wav", + "spider_hit": "spider_hit.wav", + "spider_death": "spider_death.wav", + "spider_attack": "spider_attack.wav", + "ghost_hit": "spider_hit.wav", + "ghost_death": "spider_death.wav", + "ghost_attack": "spider_attack.wav", + "ghoul_attack": "ghoul_attack.ogg", + "ghoul_hit": "ghoul_hit.ogg", + "ghoul_death": "ghoul_death.ogg", + "hit": "step.wav", + "death": "step.wav", + "attack": "step.wav", + "dispell": "dispell.wav", + "plague": "plague.wav", + "invisibility": "invisibility.wav", + "speed": "speed.wav", + "learn": "learn.wav", + "drink": "use_elixir.ogg", + "imp_death": "imp_death.wav", + "zombie_death": "zombie_death.ogg", + "zombie_attack": "zombie_attack.ogg", + "lizardman_death": "lizardman_death.wav", + "boost": "boost.wav" }, "music": { "game": "soliloquy.mp3", diff --git a/resources/spells/bless.png b/resources/spells/bless.png new file mode 100644 index 0000000..1161fa6 Binary files /dev/null and b/resources/spells/bless.png differ diff --git a/resources/spells/bone_golem.png b/resources/spells/bone_golem.png new file mode 100644 index 0000000..2e9aaae Binary files /dev/null and b/resources/spells/bone_golem.png differ diff --git a/resources/spells/chains_of_dread.png b/resources/spells/chains_of_dread.png new file mode 100644 index 0000000..c189966 Binary files /dev/null and b/resources/spells/chains_of_dread.png differ diff --git a/resources/spells/concealment.png b/resources/spells/concealment.png new file mode 100644 index 0000000..c6aa5b1 Binary files /dev/null and b/resources/spells/concealment.png differ diff --git a/resources/spells/curse.png b/resources/spells/curse.png new file mode 100644 index 0000000..eb6f9e6 Binary files /dev/null and b/resources/spells/curse.png differ diff --git a/resources/spells/eagle_eye.png b/resources/spells/eagle_eye.png new file mode 100644 index 0000000..90df9ac Binary files /dev/null and b/resources/spells/eagle_eye.png differ diff --git a/resources/spells/fire_golem.png b/resources/spells/fire_golem.png new file mode 100644 index 0000000..2e9aaae Binary files /dev/null and b/resources/spells/fire_golem.png differ diff --git a/resources/spells/living_armor.png b/resources/spells/living_armor.png new file mode 100644 index 0000000..cd229dc Binary files /dev/null and b/resources/spells/living_armor.png differ diff --git a/resources/spells/meteor_shower.png b/resources/spells/meteor_shower.png new file mode 100644 index 0000000..71df5e5 Binary files /dev/null and b/resources/spells/meteor_shower.png differ diff --git a/resources/spells/plague.png b/resources/spells/plague.png new file mode 100644 index 0000000..c741821 Binary files /dev/null and b/resources/spells/plague.png differ diff --git a/resources/spells/rust.png b/resources/spells/rust.png new file mode 100644 index 0000000..856e21f Binary files /dev/null and b/resources/spells/rust.png differ diff --git a/resources/spells/skeletion.png b/resources/spells/skeletion.png new file mode 100644 index 0000000..2e9aaae Binary files /dev/null and b/resources/spells/skeletion.png differ diff --git a/resources/spells/speed.png b/resources/spells/speed.png new file mode 100644 index 0000000..46ed87a Binary files /dev/null and b/resources/spells/speed.png differ diff --git a/resources/spells/stone_golem.png b/resources/spells/stone_golem.png new file mode 100644 index 0000000..2e9aaae Binary files /dev/null and b/resources/spells/stone_golem.png differ diff --git a/resources/spells/strength.png b/resources/spells/strength.png new file mode 100644 index 0000000..93c1da0 Binary files /dev/null and b/resources/spells/strength.png differ diff --git a/resources/spells/true_healing.png b/resources/spells/true_healing.png new file mode 100644 index 0000000..ccde8ca Binary files /dev/null and b/resources/spells/true_healing.png differ diff --git a/resources/spells/weaken.png b/resources/spells/weaken.png new file mode 100644 index 0000000..30daae8 Binary files /dev/null and b/resources/spells/weaken.png differ diff --git a/sources/Game/Elinor.Battle.pas b/sources/Game/Elinor.Battle.pas index 7d0b4db..2a814df 100644 --- a/sources/Game/Elinor.Battle.pas +++ b/sources/Game/Elinor.Battle.pas @@ -81,7 +81,7 @@ procedure TBattle.CheckArtifactVampiricAttack(const AAtkParty, LDamage := AAtkParty.Creature[AAtkPos].Damage.GetFullValue; LValue := Percent(LDamage, TLeaderParty.LeaderVampiricAttackValue); Sleep(50); - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('heal'); AAtkParty.Heal(AAtkPos, EnsureRange(LValue, 5, 50)); LStr := TResources.RandomValue('battle.string', 'drain_life'); FBattleLog.Log.Add(Format(LStr, [TCreature.Character(AAtkCrEnum).Name[0], @@ -172,7 +172,7 @@ procedure TBattle.DamageCreature(LAtkCrEnum: TCreatureEnum; AAtkParty: TParty; if LIsCrit then begin FBattleLog.CriticalAttack; - Game.MediaPlayer.PlaySound(mmCriticalAttack); + Game.MediaPlayer.PlaySound('critical_attack'); Sleep(50); end else @@ -181,7 +181,7 @@ procedure TBattle.DamageCreature(LAtkCrEnum: TCreatureEnum; AAtkParty: TParty; atDrainLife: begin Sleep(50); - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('heal'); AAtkParty.Heal(AAtkPos, EnsureRange(LDamage div 2, 5, 100)); end; end; diff --git a/sources/Game/Elinor.Creatures.pas b/sources/Game/Elinor.Creatures.pas index 93f9a93..c3209a0 100644 --- a/sources/Game/Elinor.Creatures.pas +++ b/sources/Game/Elinor.Creatures.pas @@ -320,7 +320,7 @@ TCreatureBase = record SourceEnum: TSourceEnum; ReachEnum: TReachEnum; Gold: Integer; - Sound: array [TCrSoundEnum] of TMusicEnum; + Sound: array [TCrSoundEnum] of string; Gender: TCreatureGender; AttackEnum: TAttackEnum; AbilityEnum: TAbilityEnum; @@ -389,7 +389,7 @@ implementation Size: szSmall; Name: ('', ''); Description: ('', '', ''); HitPoints: 0; Initiative: 0; ChancesToHit: 0; Leadership: 0; Level: 0; Damage: 0; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 0; - Sound: (mmHit, mmDeath, mmAttack); Gender: cgMale; AttackEnum: atMagic; + Sound: ('hit', 'death', 'attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 0;), // The Empire {$REGION The Empire} @@ -401,7 +401,7 @@ implementation 'He protects the capital from enemies.'); HitPoints: 900; Initiative: 90; ChancesToHit: 95; Leadership: 5; Level: 1; Damage: 250; Armor: 50; Heal: 0; SourceEnum: seLife; ReachEnum: reAll; Gold: 0; - Sound: (mmHit, mmDeath, mmAttack); Gender: cgMale; AttackEnum: atMagic; + Sound: ('hit', 'death', 'attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 0;), // Paladin (Ident: 'none'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrPaladin; @@ -411,7 +411,7 @@ implementation 'carries him over fields and forests.'); HitPoints: 150; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 50; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atPaladinSword; AbilityEnum: abBannerBearer; Rating: 0;), // Ranger (Ident: 'none'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrRanger; @@ -421,7 +421,7 @@ implementation 'ten sends them on scouting missions.'); HitPoints: 90; Initiative: 60; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmBowAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'bow_attack'); Gender: cgMale; AttackEnum: atHunterBow; AbilityEnum: abTravelLore; Rating: 0;), // Archmage (Ident: 'none'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrArchmage; @@ -430,7 +430,7 @@ implementation 'only commander in the Empire who can', 'use scrolls and staves.'); HitPoints: 65; Initiative: 40; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 30; Armor: 0; Heal: 0; SourceEnum: seAir; ReachEnum: reAll; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmStaffAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abUseStaffsAndScrolls; Rating: 0;), // Thief (Ident: 'none'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrThief; @@ -440,7 +440,7 @@ implementation 'serve the Empire by gathering vital intel.'); HitPoints: 100; Initiative: 60; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 30; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmDaggerAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDagger; AbilityEnum: abStealth; Rating: 0;), // Warlord (Ident: 'none'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrWarlord; @@ -449,7 +449,7 @@ implementation 'Empire with loyalty and ruthlessly', 'deals with its enemies.'); HitPoints: 120; Initiative: 55; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 0; Sound: (mmHumHit, mmHumDeath, mmAxeAttack); Gender: cgMale; + Gold: 0; Sound: ('hum_hit', 'hum_death', 'axe_attack'); Gender: cgMale; AttackEnum: atBattleAxe; AbilityEnum: abTemplar; Rating: 0;), // Squire (Ident: 'squire'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrSquire; @@ -458,7 +458,7 @@ implementation 'his weaker compatriots, keeping', 'foes at sword’s length.'); HitPoints: 100; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 50; Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Gold: 50; Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atLongSword; AbilityEnum: abNone; Rating: 25;), // Archer (Ident: 'archer'; Faction: faTheEmpire; SubRace: reHuman; ResEnum: mrArcher; @@ -467,7 +467,7 @@ implementation 'enemies hiding behind the backs', 'of their stronger comrades.'); HitPoints: 45; Initiative: 60; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; - Gold: 40; Sound: (mmHumHit, mmHumDeath, mmBowAttack); Gender: cgMale; + Gold: 40; Sound: ('hum_hit', 'hum_death', 'bow_attack'); Gender: cgMale; AttackEnum: atBow; AbilityEnum: abNone; Rating: 10;), // Apprentice (Ident: 'apprentice'; Faction: faTheEmpire; SubRace: reHuman; @@ -476,7 +476,7 @@ implementation 'from afar, unleashing lightning', 'upon them.'); HitPoints: 35; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seAir; ReachEnum: reAll; Gold: 60; - Sound: (mmHumHit, mmHumDeath, mmStaffAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 5;), // Acolyte (Ident: 'acolyte'; Faction: faTheEmpire; SubRace: reHuman; @@ -485,7 +485,7 @@ implementation 'can tend to wounded allies, treating', 'their injuries one by one.'); HitPoints: 50; Initiative: 10; ChancesToHit: 100; Leadership: 0; Level: 1; Damage: 0; Armor: 0; Heal: 20; SourceEnum: seAir; ReachEnum: reAny; - Gold: 100; Sound: (mmHit, mmDeath, mmAttack); Gender: cgFemale; + Gold: 100; Sound: ('hit', 'death', 'attack'); Gender: cgFemale; AttackEnum: atHealing; AbilityEnum: abNone; Rating: 5;), {$ENDREGION The Empire} // Undead Hordes @@ -497,7 +497,7 @@ implementation 'the high priest of Alkmaar.', 'He never leaves the capital unguarded.'); HitPoints: 900; Initiative: 90; ChancesToHit: 95; Leadership: 5; Level: 1; Damage: 250; Armor: 50; Heal: 0; SourceEnum: seLife; ReachEnum: reAll; - Gold: 0; Sound: (mmHit, mmDeath, mmAttack); Gender: cgMale; + Gold: 0; Sound: ('hit', 'death', 'attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 0;), // Death Knight (Ident: 'none'; Faction: faUndeadHordes; SubRace: reUndead; @@ -508,7 +508,7 @@ implementation 'from oblivion by Mortis through the Death Knights.'); HitPoints: 150; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 50; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atSlayerSword; AbilityEnum: abBannerBearer; Rating: 0;), // Nosferat (Ident: 'none'; Faction: faUndeadHordes; SubRace: reVampire; @@ -518,7 +518,7 @@ implementation 'Mortis in exchange for power over death.'); HitPoints: 90; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 10; Armor: 0; Heal: 0; SourceEnum: seDeath; ReachEnum: reAny; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmNosferatAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'nosferat_attack'); Gender: cgMale; AttackEnum: atDrainLife; AbilityEnum: abVampirism; Rating: 0;), // Lich Queen (Ident: 'none'; Faction: faUndeadHordes; SubRace: reUndead; @@ -527,8 +527,9 @@ implementation 'Alkmaar, returned by the will of Mortis', 'as merciless Lich Queens.'); HitPoints: 65; Initiative: 40; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 30; Armor: 0; Heal: 0; SourceEnum: seFire; ReachEnum: reAll; - Gold: 0; Sound: (mmHumHit, mmHumDeath, mmLichQueenAttack); Gender: cgFemale; - AttackEnum: atMagic; AbilityEnum: abUseStaffsAndScrolls; Rating: 0;), + Gold: 0; Sound: ('hum_hit', 'hum_death', 'lich_queen_attack'); + Gender: cgFemale; AttackEnum: atMagic; AbilityEnum: abUseStaffsAndScrolls; + Rating: 0;), // Thug (Ident: 'none'; Faction: faUndeadHordes; SubRace: reUndead; ResEnum: mrThug; Size: szSmall; Name: ('Thug', 'Thug'); @@ -537,7 +538,7 @@ implementation 'ning where strength is not enough.'); HitPoints: 100; Initiative: 60; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 30; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmDaggerAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDaggerOfShadows; AbilityEnum: abStealth; Rating: 0;), // Dominator (Ident: 'none'; Faction: faUndeadHordes; SubRace: reUndead; @@ -546,7 +547,7 @@ implementation 'turned to life by Mortis to sow death', 'and destruction all around.'); HitPoints: 125; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 35; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 0; Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Gold: 0; Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atBattleAxe; AbilityEnum: abTemplar; Rating: 0;), // Fighter (Ident: 'fighter'; Faction: faUndeadHordes; SubRace: reUndead; @@ -556,7 +557,7 @@ implementation 'They know neither fear nor mercy.'); HitPoints: 120; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 50; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atLongSword; AbilityEnum: abNone; Rating: 30;), // Ghost (Ident: 'ghost'; Faction: faUndeadHordes; SubRace: reUndead; @@ -565,7 +566,7 @@ implementation 'to the world of the living.'); HitPoints: 45; Initiative: 20; ChancesToHit: 60; Leadership: 0; Level: 1; Damage: 0; Armor: 0; Heal: 0; SourceEnum: seMind; ReachEnum: reAny; Gold: 50; - Sound: (mmGhostHit, mmGhostDeath, mmGhostAttack); Gender: cgMale; + Sound: ('ghost_hit', 'ghost_death', 'ghost_attack'); Gender: cgMale; AttackEnum: atParalyze; AbilityEnum: abNone; Rating: 10;), // Initiate (Ident: 'initiate'; Faction: faUndeadHordes; SubRace: reUndead; @@ -575,7 +576,7 @@ implementation 'of their goddess Mortis.'); HitPoints: 45; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seDeath; ReachEnum: reAll; Gold: 60; - Sound: (mmHumHit, mmHumDeath, mmStaffAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 10;), // Wyvern (Ident: 'wyvern'; Faction: faUndeadHordes; SubRace: reUndeadDragon; @@ -584,7 +585,7 @@ implementation 'thus creating wyverns that fight', 'in the ranks of the undead army.'); HitPoints: 225; Initiative: 35; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seDeath; ReachEnum: reAll; - Gold: 100; Sound: (mmHit, mmDeath, mmAttack); Gender: cgFemale; + Gold: 100; Sound: ('hit', 'death', 'attack'); Gender: cgFemale; AttackEnum: atPoisonousBreath; AbilityEnum: abNone; Rating: 40;), {$ENDREGION UndeadHordes} // Legions Of The Damned @@ -597,7 +598,7 @@ implementation 'never leaving it undefended.'); HitPoints: 900; Initiative: 90; ChancesToHit: 95; Leadership: 5; Level: 1; Damage: 250; Armor: 50; Heal: 0; SourceEnum: seLife; ReachEnum: reAll; Gold: 0; - Sound: (mmHit, mmDeath, mmAttack); Gender: cgMale; AttackEnum: atMagic; + Sound: ('hit', 'death', 'attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 0;), // Duke (Ident: 'none'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -606,7 +607,7 @@ implementation 'в битву, сжимая меч в окровавленных', 'руках.'); HitPoints: 150; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 50; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atPhoenixSword; AbilityEnum: abFlying; Rating: 0;), // Counselor (Ident: 'none'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -615,7 +616,7 @@ implementation 'Он путешествует по землям Невендаара', 'с высокой скоростью.'); HitPoints: 90; Initiative: 40; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; - Gold: 0; Sound: (mmHumHit, mmHumDeath, mmBowAttack); Gender: cgMale; + Gold: 0; Sound: ('hum_hit', 'hum_death', 'bow_attack'); Gender: cgMale; AttackEnum: atCrossbow; AbilityEnum: abTravelLore; Rating: 0;), // Arch-Devil (Ident: 'none'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -624,7 +625,7 @@ implementation 'он обладает глубокими знаниями', 'о посохах и свитках.'); HitPoints: 65; Initiative: 40; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 30; Armor: 0; Heal: 0; SourceEnum: seFire; ReachEnum: reAll; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmStaffAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abUseStaffsAndScrolls; Rating: 0;), // Ripper (Ident: 'none'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -633,7 +634,7 @@ implementation 'медленном и мастерском извлечении', 'правды из его жертв.'); HitPoints: 90; Initiative: 60; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 35; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmDaggerAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atFlameDagger; AbilityEnum: abStealth; Rating: 0;), // Chieftain (Ident: 'none'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -642,7 +643,7 @@ implementation 'отрядов демонов и ведут адские', 'когорты в бой.'); HitPoints: 110; Initiative: 50; ChancesToHit: 80; Leadership: 1; Level: 1; Damage: 45; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 0; - Sound: (mmHumHit, mmHumDeath, mmClubAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'club_attack'); Gender: cgMale; AttackEnum: atFireHammer; AbilityEnum: abTemplar; Rating: 0;), // Possessed (Ident: 'possessed'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -652,7 +653,7 @@ implementation 'бы они сражались в адских сражениях.'); HitPoints: 120; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 50; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atLongSword; AbilityEnum: abNone; Rating: 30;), // Gargoyle (Ident: 'gargoyle'; Faction: faLegionsOfTheDamned; SubRace: reGargoyle; @@ -661,7 +662,7 @@ implementation 'часть получаемого урона, делая', 'из них прекрасных защитных воинов.'); HitPoints: 75; Initiative: 60; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 25; Armor: 15; Heal: 0; SourceEnum: seEarth; ReachEnum: reAny; - Gold: 90; Sound: (mmHit, mmDeath, mmAttack); Gender: cgFemale; + Gold: 90; Sound: ('hit', 'death', 'attack'); Gender: cgFemale; AttackEnum: atStones; AbilityEnum: abNone; Rating: 30;), // Cultist (Ident: 'cultist'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -670,7 +671,7 @@ implementation 'адским силам, дабы призвать огонь', 'на всех своих врагов в битве.'); HitPoints: 45; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seFire; ReachEnum: reAll; - Gold: 60; Sound: (mmHumHit, mmHumDeath, mmStaffAttack); Gender: cgMale; + Gold: 60; Sound: ('hum_hit', 'hum_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 20;), // Devil (Ident: 'devil'; Faction: faLegionsOfTheDamned; SubRace: reHeretic; @@ -679,7 +680,7 @@ implementation 'Тёмного Повелителя Бетрезена.'); HitPoints: 120; Initiative: 35; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 100; - Sound: (mmHit, mmDeath, mmAttack); Gender: cgMale; AttackEnum: atClaws; + Sound: ('hit', 'death', 'attack'); Gender: cgMale; AttackEnum: atClaws; AbilityEnum: abNone; Rating: 35;), {$ENDREGION Legions Of The Damned} // Neutral Green Skins @@ -691,7 +692,7 @@ implementation 'They are not as strong,', 'but they are cunning and agile.'); HitPoints: 50; Initiative: 30; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seLife; ReachEnum: reAdj; - Gold: 50; Sound: (mmGoblinHit, mmGoblinDeath, mmSpearAttack); + Gold: 50; Sound: ('goblin_hit', 'goblin_death', 'spear_attack'); Gender: cgMale; AttackEnum: atSpear; AbilityEnum: abNone; Rating: 25;), // Goblin Rider (Ident: 'goblin-rider'; Faction: faNeutrals; SubRace: reGreenSkin; @@ -701,7 +702,7 @@ implementation 'wargs and use them in battle', 'as a means of transportation.'); HitPoints: 75; Initiative: 35; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seLife; ReachEnum: reAdj; - Gold: 150; Sound: (mmGoblinHit, mmGoblinDeath, mmDaggerAttack); + Gold: 150; Sound: ('goblin_hit', 'goblin_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDagger; AbilityEnum: abNone; Rating: 35;), // Goblin Archer (Ident: 'goblin-archer'; Faction: faNeutrals; SubRace: reGreenSkin; @@ -711,7 +712,7 @@ implementation 'in ambushes and raids,', 'using crude arrows.'); HitPoints: 40; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 75; - Sound: (mmGoblinHit, mmGoblinDeath, mmBowAttack); Gender: cgMale; + Sound: ('goblin_hit', 'goblin_death', 'bow_attack'); Gender: cgMale; AttackEnum: atBow; AbilityEnum: abNone; Rating: 20;), // Goblin Elder (Ident: 'goblin-elder'; Faction: faNeutrals; SubRace: reGreenSkin; @@ -721,7 +722,7 @@ implementation 'to practice the art of magic,', 'but from time to time elders do emerge.'); HitPoints: 35; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 10; Armor: 0; Heal: 0; SourceEnum: seFire; ReachEnum: reAll; - Gold: 100; Sound: (mmGoblinHit, mmGoblinDeath, mmStaffAttack); + Gold: 100; Sound: ('goblin_hit', 'goblin_death', 'staff_attack'); Gender: cgMale; AttackEnum: atMagic; AbilityEnum: abNone; Rating: 10;), // Black Goblin (Ident: 'black-goblin'; Faction: faNeutrals; SubRace: reGreenSkin; @@ -731,7 +732,7 @@ implementation 'to master the art of killing,', 'but those who do become assassins.'); HitPoints: 60; Initiative: 35; ChancesToHit: 75; Leadership: 0; Level: 1; Damage: 20; Armor: 0; Heal: 0; SourceEnum: seLife; ReachEnum: reAny; - Gold: 65; Sound: (mmGoblinHit, mmGoblinDeath, mmDaggerAttack); + Gold: 65; Sound: ('goblin_hit', 'goblin_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDagger; AbilityEnum: abNone; Rating: 30;), // Orc @@ -741,7 +742,7 @@ implementation 'front lines in battles, because they', 'have a sturdy build.'); HitPoints: 200; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 55; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 200; Sound: (mmOrcHit, mmOrcDeath, mmAxeAttack); Gender: cgMale; + Gold: 200; Sound: ('orc_hit', 'orc_death', 'axe_attack'); Gender: cgMale; AttackEnum: atBattleAxe; AbilityEnum: abNone; Rating: 40;), // Trog @@ -750,7 +751,7 @@ implementation Description: ('Trogs are savage creatures,', ' driven only by brute ', 'force.'); HitPoints: 250; Initiative: 30; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 110; Armor: 0; Heal: 0; SourceEnum: seWeapon; - ReachEnum: reAdj; Gold: 270; Sound: (mmOrcHit, mmOrcDeath, mmClubAttack); + ReachEnum: reAdj; Gold: 270; Sound: ('orc_hit', 'orc_death', 'club_attack'); Gender: cgMale; AttackEnum: atClaws; AbilityEnum: abNone; Rating: 50;), // Troll (Ident: 'troll'; Faction: faNeutrals; SubRace: reGreenSkin; @@ -759,7 +760,7 @@ implementation 'slow but incredibly strong,', 'thriving in caves and ruins.'); HitPoints: 300; Initiative: 25; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 120; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 300; Sound: (mmOrcHit, mmOrcDeath, mmClubAttack); Gender: cgMale; + Gold: 300; Sound: ('orc_hit', 'orc_death', 'club_attack'); Gender: cgMale; AttackEnum: atClub; AbilityEnum: abNone; Rating: 60;), // Ogre (Ident: 'ogre'; Faction: faNeutrals; SubRace: reGreenSkin; ResEnum: mrOgre; @@ -768,7 +769,7 @@ implementation 'tactics or strategy.'); HitPoints: 350; Initiative: 20; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 130; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 350; - Sound: (mmOrcHit, mmOrcDeath, mmClubAttack); Gender: cgMale; + Sound: ('orc_hit', 'orc_death', 'club_attack'); Gender: cgMale; AttackEnum: atClub; AbilityEnum: abNone; Rating: 70;), {$ENDREGION Green Skins} // @@ -779,7 +780,7 @@ implementation 'silent and deadly, striking', 'from the swamps and marshes'); HitPoints: 250; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 60; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; - Gold: 250; Sound: (mmLizardmanHit, mmLizardmanDeath, mmBowAttack); + Gold: 250; Sound: ('lizardman_hit', 'lizardman_death', 'bow_attack'); Gender: cgMale; AttackEnum: atBow; AbilityEnum: abNone; Rating: 45;), // Neutral Humans @@ -791,7 +792,7 @@ implementation 'they call their home.'); HitPoints: 40; Initiative: 30; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 15; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 50; - Sound: (mmHumHit, mmHumDeath, mmSpearAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'spear_attack'); Gender: cgMale; AttackEnum: atSpear; AbilityEnum: abNone; Rating: 10;), // Man at Arms (Ident: 'man-at-arms'; Faction: faNeutrals; SubRace: reHuman; @@ -800,7 +801,7 @@ implementation 'services to anyone who pays', 'a gold coin.'); HitPoints: 95; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 100; - Sound: (mmHumHit, mmHumDeath, mmSwordAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'sword_attack'); Gender: cgMale; AttackEnum: atLongSword; AbilityEnum: abNone; Rating: 30;), // Rogue (Ident: 'rogue'; Faction: faNeutrals; SubRace: reHuman; ResEnum: mrRogue; @@ -809,7 +810,7 @@ implementation 'and attack defenseless travelers', 'along roads and forest paths.'); HitPoints: 75; Initiative: 65; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 80; Sound: (mmHumHit, mmHumDeath, mmDaggerAttack); Gender: cgMale; + Gold: 80; Sound: ('hum_hit', 'hum_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDagger; AbilityEnum: abNone; Rating: 20;), {$ENDREGION Humans} // Neutral Undeads @@ -821,7 +822,7 @@ implementation 'capable of affecting the mind', 'of their victims.'); HitPoints: 150; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 35; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 125; - Sound: (mmGhoulHit, mmGhoulDeath, mmGhoulAttack); Gender: cgMale; + Sound: ('ghoul_hit', 'ghoul_death', 'ghoul_attack'); Gender: cgMale; AttackEnum: atClaws; AbilityEnum: abNone; Rating: 40;), // Dark Elf Gast (Ident: 'dark-elf-gast'; Faction: faNeutrals; SubRace: reDarkElf; @@ -831,7 +832,7 @@ implementation 'Death twisted them into undead abominations.'); HitPoints: 110; Initiative: 40; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 40; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAny; Gold: 125; - Sound: (mmHumHit, mmHumDeath, mmDaggerAttack); Gender: cgMale; + Sound: ('hum_hit', 'hum_death', 'dagger_attack'); Gender: cgMale; AttackEnum: atDaggerOfShadows; AbilityEnum: abNone; Rating: 45;), // Skeleton Warrior (Ident: 'skeleton-warrior'; Faction: faNeutrals; SubRace: reUndead; @@ -841,7 +842,7 @@ implementation 'warriors raised by dark forces', 'to fight without fear.'); HitPoints: 100; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 25; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 95; - Sound: (mmSkeletonHit, mmSkeletonDeath, mmSwordAttack); Gender: cgMale; + Sound: ('skeleton_hit', 'skeleton_death', 'sword_attack'); Gender: cgMale; AttackEnum: atSlayerSword; AbilityEnum: abNone; Rating: 30;), // Zombie (Ident: 'zombie'; Faction: faNeutrals; SubRace: reUndead; ResEnum: mrZombie; @@ -850,7 +851,7 @@ implementation 'acting consciously, but each of ', 'them remains a deadly threat.'); HitPoints: 200; Initiative: 45; ChancesToHit: 65; Leadership: 0; Level: 1; Damage: 50; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 275; Sound: (mmZombieHit, mmZombieDeath, mmZombieAttack); + Gold: 275; Sound: ('zombie_hit', 'zombie_death', 'zombie_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 60;), // Reaper (Ident: 'reaper'; Faction: faNeutrals; SubRace: reUndead; ResEnum: mrReaper; @@ -859,8 +860,8 @@ implementation 'of absolute Void and are capable', 'of affecting the mind.'); HitPoints: 250; Initiative: 55; ChancesToHit: 80; Leadership: 0; Level: 4; Damage: 75; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 325; Sound: (mmGhoulHit, mmGhoulDeath, mmGhoulAttack); Gender: cgMale; - AttackEnum: atScythe; AbilityEnum: abNone; Rating: 70;), + Gold: 325; Sound: ('ghoul_hit', 'ghoul_death', 'ghoul_attack'); + Gender: cgMale; AttackEnum: atScythe; AbilityEnum: abNone; Rating: 70;), {$ENDREGION Undeads} // Neutral Heretics {$REGION Heretics} @@ -871,7 +872,7 @@ implementation 'and dangerous in close combat.'); HitPoints: 75; Initiative: 45; ChancesToHit: 75; Leadership: 0; Level: 1; Damage: 20; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 75; - Sound: (mmImpHit, mmImpDeath, mmSwordAttack); Gender: cgMale; + Sound: ('imp_hit', 'imp_death', 'sword_attack'); Gender: cgMale; AttackEnum: atShortSword; AbilityEnum: abNone; Rating: 35;), {$ENDREGION Heretics} // Neutral Animals @@ -883,7 +884,7 @@ implementation 'spider completely paralyzes the', 'victim, preventing escape.'); HitPoints: 420; Initiative: 35; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 130; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; - Gold: 400; Sound: (mmSpiderHit, mmSpiderDeath, mmSpiderAttack); + Gold: 400; Sound: ('spider_hit', 'spider_death', 'spider_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 80;), // Wolf @@ -894,7 +895,7 @@ implementation 'the warriors who cross their path.'); HitPoints: 180; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 55; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 200; - Sound: (mmWolfHit, mmWolfDeath, mmWolfAttack); Gender: cgMale; + Sound: ('wolf_hit', 'wolf_death', 'wolf_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 70;), // Dire Wolf (Ident: 'dire-wolf'; Faction: faNeutrals; SubRace: reAnimal; @@ -904,7 +905,7 @@ implementation 'Few survive an encounter with one.'); HitPoints: 200; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 60; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 220; - Sound: (mmWolfHit, mmWolfDeath, mmWolfAttack); Gender: cgMale; + Sound: ('wolf_hit', 'wolf_death', 'wolf_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 80;), // Spirit Wolf (Ident: 'spirit-wolf'; Faction: faNeutrals; SubRace: reAnimal; @@ -914,7 +915,7 @@ implementation 'Few survive an encounter with one.'); HitPoints: 250; Initiative: 50; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 65; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 250; - Sound: (mmWolfHit, mmWolfDeath, mmWolfAttack); Gender: cgMale; + Sound: ('wolf_hit', 'wolf_death', 'wolf_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 90;), // Polar Bear @@ -925,7 +926,7 @@ implementation 'They strike without warning when threatened.'); HitPoints: 320; Initiative: 70; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 85; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 700; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 60;), // Brown Bear (Ident: 'brown-bear'; Faction: faNeutrals; SubRace: reAnimal; @@ -935,7 +936,7 @@ implementation 'Disturbing one is often fatal.'); HitPoints: 300; Initiative: 70; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 80; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 600; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 55;), // Black Bear (Ident: 'black-bear'; Faction: faNeutrals; SubRace: reAnimal; @@ -945,7 +946,7 @@ implementation 'A cornered black bear is a fierce opponent.'); HitPoints: 280; Initiative: 70; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 75; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 500; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 50;), {$ENDREGION Animals} // Golems @@ -956,7 +957,7 @@ implementation Description: ('', '', ''); HitPoints: 240; Initiative: 40; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 50; Armor: 5; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 700; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 50;), // Stone Golem (Ident: 'stone-golem'; Faction: faNeutrals; SubRace: reGolem; @@ -964,7 +965,7 @@ implementation Description: ('', '', ''); HitPoints: 210; Initiative: 40; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 55; Armor: 5; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 650; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 45;), // Fire Golem (Ident: 'fire-golem'; Faction: faNeutrals; SubRace: reGolem; @@ -972,7 +973,7 @@ implementation Description: ('', '', ''); HitPoints: 220; Initiative: 40; ChancesToHit: 70; Leadership: 0; Level: 1; Damage: 55; Armor: 5; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAdj; Gold: 675; - Sound: (mmBearHit, mmBearDeath, mmBearAttack); Gender: cgMale; + Sound: ('bear_hit', 'bear_death', 'bear_attack'); Gender: cgMale; AttackEnum: atBites; AbilityEnum: abNone; Rating: 45;), {$ENDREGION Golems} // Dragons @@ -984,7 +985,7 @@ implementation 'dragon melts flesh and armor,', 'making escape impossible.'); HitPoints: 800; Initiative: 40; ChancesToHit: 75; Leadership: 0; Level: 1; Damage: 125; Armor: 0; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAll; - Gold: 2000; Sound: (mmSpiderHit, mmSpiderDeath, mmSpiderAttack); + Gold: 2000; Sound: ('spider_hit', 'spider_death', 'spider_attack'); Gender: cgMale; AttackEnum: atFireBreath; AbilityEnum: abNone; Rating: 350;), // White Dragon @@ -994,7 +995,7 @@ implementation 'dragon locks the victim in ice,', 'leaving no chance to flee.'); HitPoints: 900; Initiative: 40; ChancesToHit: 80; Leadership: 0; Level: 1; Damage: 120; Armor: 10; Heal: 0; SourceEnum: seWeapon; ReachEnum: reAll; - Gold: 2500; Sound: (mmSpiderHit, mmSpiderDeath, mmSpiderAttack); + Gold: 2500; Sound: ('spider_hit', 'spider_death', 'spider_attack'); Gender: cgMale; AttackEnum: atIceBreath; AbilityEnum: abNone; Rating: 400;) {$ENDREGION Dragons} // diff --git a/sources/Game/Elinor.MediaPlayer.pas b/sources/Game/Elinor.MediaPlayer.pas index ac02ded..b3a19cc 100644 --- a/sources/Game/Elinor.MediaPlayer.pas +++ b/sources/Game/Elinor.MediaPlayer.pas @@ -32,14 +32,10 @@ TMediaPlayer = class(TObject) property SoundVolume: ShortInt read GetSoundVolume write SetSoundVolume; property MusicVolume: ShortInt read GetMusicVolume write SetMusicVolume; property CurrentChannel: Integer read FCurrentChannel write FCurrentChannel; - function PlaySound(const FileName: string; F: Boolean = False) - : Boolean; overload; - function PlaySound(const MusicEnum: TMusicEnum; F: Boolean = False) - : Boolean; overload; - function PlayMusic(const FileName: string; F: Boolean = True) - : Boolean; overload; - function PlayMusic(const MusicEnum: TMusicEnum; F: Boolean = True) + function PlaySound(const AKey: string; F: Boolean = False) : Boolean; overload; + function PlayMusic(const AKey: string; F: Boolean = True): Boolean; + overload; procedure StopSound; procedure StopMusic; end; @@ -92,29 +88,17 @@ function TMediaPlayer.IsPlayMusic: Boolean; Result := BASS_ChannelIsActive(FChannel[MusicChannel]) = BASS_ACTIVE_PLAYING; end; -function TMediaPlayer.PlayMusic(const FileName: string; F: Boolean): Boolean; +function TMediaPlayer.PlayMusic(const AKey: string; F: Boolean): Boolean; begin StopMusic; CurrentChannel := MusicChannel; - Play(R.Music[FileName + '.mp3'], F, mtMusic); + Play(R.Musics[AKey], F, mtMusic); CurrentChannel := SoundChannel; end; -function TMediaPlayer.PlayMusic(const MusicEnum: TMusicEnum; - F: Boolean): Boolean; -begin - // PlayMusic(ResMusicPath[MusicEnum], F); -end; - -function TMediaPlayer.PlaySound(const MusicEnum: TMusicEnum; - F: Boolean): Boolean; -begin - PlaySound(ResMusicPath[MusicEnum], F); -end; - -function TMediaPlayer.PlaySound(const FileName: string; F: Boolean): Boolean; +function TMediaPlayer.PlaySound(const AKey: string; F: Boolean): Boolean; begin - Play(FileName, F, mtSound); + Play(R.Sounds[AKey], F, mtSound); end; function TMediaPlayer.Play(const FileName: string; F: Boolean; diff --git a/sources/Game/Elinor.NewResources.pas b/sources/Game/Elinor.NewResources.pas index 3cbca7c..e986616 100644 --- a/sources/Game/Elinor.NewResources.pas +++ b/sources/Game/Elinor.NewResources.pas @@ -6,26 +6,18 @@ interface System.SysUtils, System.Generics.Collections, System.StrUtils, + System.IOUtils, + System.JSON, Vcl.Imaging.PNGImage; type - // Базовый интерфейс для чтения данных о ресурсах IResourceLoader = interface - /// - /// Возвращает объект по ключу. Если ключ не найден — бросает ***. - /// + ['{8B5E8C4A-5F2D-4E8A-9B3C-7D1E2F4A6B9C}'] function Get(const Key: string): T; - property Items[const Key: string]: T read Get; default; - - /// - /// Возвращает ключи всех доступных ресурсов, которые начинаются с префикса. - /// function GetKeys(const prefix: string = ''): TArray; end; - // возвращает сам ключ - // использовать в тех местах, где нужен только путь к файлу TEchoResourceLoader = class(TInterfacedObject, IResourceLoader) private function Get(const Key: string): string; @@ -38,29 +30,49 @@ TPrefixedResourceLoader = class(TInterfacedObject, IResourceLoader) private FParent: IResourceLoader; FPrefix: string; - function Get(const Key: string): T; public constructor Create(AParent: IResourceLoader; const APrefix: string); - property Items[const Key: string]: T read Get; default; function GetKeys(const prefix: string = ''): TArray; end; + TJsonResourceLoader = class(TInterfacedObject, IResourceLoader) + private + FSection: TJSONObject; + function Get(const Key: string): string; + public + constructor Create(ARoot: TJSONObject; const ASectionName: string); + property Items[const Key: string]: string read Get; default; + function GetKeys(const prefix: string = ''): TArray; + end; + + TValuePathResourceLoader = class(TInterfacedObject, IResourceLoader) + private + FParent: IResourceLoader; + FBasePath: string; + function Get(const Key: string): string; + public + constructor Create(AParent: IResourceLoader; + const ABasePath: string); + property Items[const Key: string]: string read Get; default; + function GetKeys(const prefix: string = ''): TArray; + end; + IResourceCache = interface + ['{3F2A1B7C-8D4E-4F9A-9B2C-1E7F5A3D6B8E}'] procedure LoadAll(); end; - TCachedResourceLoader = class(TInterfacedObject, IResourceLoader, IResourceCache) + TCachedResourceLoader = class(TInterfacedObject, IResourceLoader, + IResourceCache) private FParent: IResourceLoader; FCache: TDictionary; - function Get(const Key: string): T; public constructor Create(AParent: IResourceLoader); destructor Destroy; override; - property Items[const Key: string]: T read Get; default; function GetKeys(const prefix: string = ''): TArray; procedure LoadAll(); @@ -76,33 +88,22 @@ TPNGImageLoader = class(TInterfacedObject, IResourceLoader) TResourceSchema = class private - FMusic, FSound: IResourceLoader; - - FCharacter, FItem, FSpell: IResourceLoader; - - FCharacterCache, FItemCache, FSpellCache: IResourceCache; - + FJsonRoot: TJSONObject; + FMusics, FSounds: IResourceLoader; + FCharacters, FItems, FSpells: IResourceLoader; + FCharactersCache, FItemsCache, FSpellsCache: IResourceCache; public constructor Create(); + destructor Destroy; override; procedure LoadAll(); - property Music: IResourceLoader read FMusic; - property Sound: IResourceLoader read FSound; - property Character: IResourceLoader read FCharacter; - property Item: IResourceLoader read FItem; - property Spell: IResourceLoader read FSpell; + property Musics: IResourceLoader read FMusics; + property Sounds: IResourceLoader read FSounds; + property Characters: IResourceLoader read FCharacters; + property Items: IResourceLoader read FItems; + property Spells: IResourceLoader read FSpells; end; -const - CMusicGame = 'soliloquy'; - CMusicMagic = 'wasteland-theme'; - CMusicBattle = 'wasteland-showdown'; - CMusicVictory = 'warsong'; - CMusicDefeat = 'defeat'; - CMusicBattleWin = 'ubermensch'; - CMusicMap = 'prologue'; - CMusicMenu = 'stellardrone'; - var R: TResourceSchema; @@ -132,36 +133,40 @@ constructor TCachedResourceLoader.Create(AParent: IResourceLoader); inherited Create; if not Assigned(AParent) then raise Exception.Create('Parent IResourceLoader must be not nil!'); + FParent := AParent; FCache := TDictionary.Create; end; -function TCachedResourceLoader.GetKeys(const prefix: string = ''): TArray; +function TCachedResourceLoader.GetKeys(const prefix: string = '') + : TArray; begin Result := FParent.GetKeys(prefix); end; -procedure TCachedResourceLoader.LoadAll(); -var keys: TArray; key: string; +procedure TCachedResourceLoader.LoadAll; +var + keys: TArray; + Key: string; begin - keys := FParent.GetKeys(); - for key in keys do - begin - FParent[key]; - end; + keys := FParent.GetKeys(''); + for Key in keys do + FParent[Key]; end; destructor TCachedResourceLoader.Destroy; begin - FCache.Free; + FreeAndNil(FCache); inherited; end; -constructor TPrefixedResourceLoader.Create(AParent: IResourceLoader; const APrefix: string); +constructor TPrefixedResourceLoader.Create(AParent: IResourceLoader; + const APrefix: string); begin inherited Create; if not Assigned(AParent) then raise Exception.Create('Parent IResourceLoader must be not nil!'); + FParent := AParent; FPrefix := APrefix; end; @@ -171,111 +176,197 @@ function TPrefixedResourceLoader.Get(const Key: string): T; Result := FParent.Get(FPrefix + Key); end; -function TPrefixedResourceLoader.GetKeys(const prefix: string = ''): TArray; +function TPrefixedResourceLoader.GetKeys(const prefix: string = '') + : TArray; var LSearchRec: TSearchRec; - LFileName: string; LFiles: TList; begin - LFiles := TList.Create(); + LFiles := TList.Create; try - if FindFirst(FPrefix + prefix + '*.*', faAnyFile, LSearchRec) = 0 then + if FindFirst(IncludeTrailingPathDelimiter(FPrefix) + prefix + '*.*', + faAnyFile, LSearchRec) = 0 then begin repeat - LFileName := LSearchRec.Name; if (LSearchRec.Attr and faDirectory) = 0 then - begin - LFiles.Add(LFileName); - end; + LFiles.Add(LSearchRec.Name); until FindNext(LSearchRec) <> 0; end; FindClose(LSearchRec); - Result := LFiles.ToArray(); + Result := LFiles.ToArray; finally LFiles.Free; end; end; -function TPNGImageLoader.Get(const Key: string): TPNGImage; +constructor TJsonResourceLoader.Create(ARoot: TJSONObject; + const ASectionName: string); +var + LValue: TJSONValue; +begin + inherited Create; + if not Assigned(ARoot) then + raise Exception.Create('Root JSON object is nil'); + + LValue := ARoot.GetValue(ASectionName); + if not(Assigned(LValue) and (LValue is TJSONObject)) then + raise Exception.CreateFmt('Section "%s" not found in JSON', [ASectionName]); + + FSection := TJSONObject(LValue); +end; + +function TJsonResourceLoader.Get(const Key: string): string; +var + LValue: TJSONValue; + CleanKey: string; +begin + CleanKey := ChangeFileExt(ExtractFileName(Key), ''); + LValue := FSection.GetValue(CleanKey); + if not Assigned(LValue) then + LValue := FSection.GetValue(Key); + + if not Assigned(LValue) then + raise Exception.CreateFmt('Key "%s" not found in JSON', [Key]); + + Result := LValue.Value; +end; + +function TJsonResourceLoader.GetKeys(const prefix: string = ''): TArray; var - LPath: string; + LList: TList; + LPair: TJSONPair; +begin + LList := TList.Create; + try + for LPair in FSection do + if StartsText(prefix, LPair.JsonString.Value) then + LList.Add(LPair.JsonString.Value); + + Result := LList.ToArray; + finally + LList.Free; + end; +end; + +constructor TValuePathResourceLoader.Create(AParent: IResourceLoader; + const ABasePath: string); +begin + inherited Create; + if not Assigned(AParent) then + raise Exception.Create('Parent IResourceLoader must be not nil!'); + + FParent := AParent; + FBasePath := IncludeTrailingPathDelimiter(ABasePath); +end; + +function TValuePathResourceLoader.Get(const Key: string): string; +begin + Result := FBasePath + FParent.Get(Key); +end; + +function TValuePathResourceLoader.GetKeys(const prefix: string = '') + : TArray; +begin + Result := FParent.GetKeys(prefix); +end; + +function TPNGImageLoader.Get(const Key: string): TPNGImage; begin Result := TPNGImage.Create; - Result.LoadFromFile(Key); + try + Result.LoadFromFile(Key); + except + Result.Free; + raise; + end; end; function TPNGImageLoader.GetKeys(const prefix: string = ''): TArray; var LSearchRec: TSearchRec; - LFileName: string; LFiles: TList; begin - LFiles := TList.Create(); + LFiles := TList.Create; try - if FindFirst(prefix + '*.*', faAnyFile, LSearchRec) = 0 then + if FindFirst(IncludeTrailingPathDelimiter(prefix) + '*.*', faAnyFile, + LSearchRec) = 0 then begin repeat - LFileName := LSearchRec.Name; if (LSearchRec.Attr and faDirectory) = 0 then - begin - LFiles.Add(LFileName); - end; + LFiles.Add(LSearchRec.Name); until FindNext(LSearchRec) <> 0; end; FindClose(LSearchRec); - Result := LFiles.ToArray(); + Result := LFiles.ToArray; finally - LFiles.Free; + FreeAndNil(LFiles); end; end; -constructor TResourceSchema.Create(); +constructor TResourceSchema.Create; var - basePath: string; - echo: IResourceLoader; - png: TPNGImageLoader; - cache: TCachedResourceLoader; + basePath, jsonPath, jsonText: string; + LPNG: TPNGImageLoader; + LCache: TCachedResourceLoader; +begin + basePath := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)) + + 'resources'); + + jsonPath := basePath + 'resources.json'; + if not TFile.Exists(jsonPath) then + raise Exception.CreateFmt('Resource file not found: %s', [jsonPath]); + + jsonText := TFile.ReadAllText(jsonPath, TEncoding.UTF8); + FJsonRoot := TJSONObject.ParseJSONValue(jsonText) as TJSONObject; + if not Assigned(FJsonRoot) then + raise Exception.CreateFmt('Failed to parse JSON: %s', [jsonPath]); + + FMusics := TValuePathResourceLoader.Create + (TJsonResourceLoader.Create(FJsonRoot, 'music'), basePath + 'music\'); + + FSounds := TValuePathResourceLoader.Create + (TJsonResourceLoader.Create(FJsonRoot, 'sounds'), basePath + 'sounds\'); + + LPNG := TPNGImageLoader.Create; + + LCache := TCachedResourceLoader.Create + (TPrefixedResourceLoader.Create(LPNG, basePath + 'characters\')); + FCharacters := LCache; + FCharactersCache := LCache; + + LCache := TCachedResourceLoader.Create + (TPrefixedResourceLoader.Create(LPNG, basePath + 'items\')); + FItems := LCache; + FItemsCache := LCache; + + LCache := TCachedResourceLoader.Create + (TPrefixedResourceLoader.Create(LPNG, basePath + 'spells\')); + FSpells := LCache; + FSpellsCache := LCache; +end; + +destructor TResourceSchema.Destroy; begin - basePath := ExtractFilePath(ParamStr(0)) + 'resources/'; - - echo := TEchoResourceLoader.Create(); - FMusic := TPrefixedResourceLoader.Create(echo, basePath + 'music/'); - FSound := TPrefixedResourceLoader.Create(echo, basePath + 'sound/'); - - png := TPNGImageLoader.Create(); - cache := TCachedResourceLoader.Create( - TPrefixedResourceLoader.Create(png, basePath + 'character/') - ); - FCharacter := cache; - FCharacterCache := cache; - - cache := TCachedResourceLoader.Create( - TPrefixedResourceLoader.Create(png, basePath + 'item/') - ); - FItem := cache; - FItemCache := cache; - - cache := TCachedResourceLoader.Create( - TPrefixedResourceLoader.Create(png, basePath + 'spell/') - ); - FSpell := cache; - FSpellCache := cache; + FMusics := nil; + FSounds := nil; + FreeAndNil(FJsonRoot); + inherited; end; -procedure TResourceSchema.LoadAll(); +procedure TResourceSchema.LoadAll; begin - FCharacterCache.LoadAll(); - FItemCache.LoadAll(); - FSpellCache.LoadAll(); + FCharactersCache.LoadAll; + FItemsCache.LoadAll; + FSpellsCache.LoadAll; end; initialization -R := TResourceSchema.Create(); -R.LoadAll(); +R := TResourceSchema.Create; +R.LoadAll; finalization -R.Free; +FreeAndNil(R); end. diff --git a/sources/Game/Elinor.Party.pas b/sources/Game/Elinor.Party.pas index e422315..6dc5db8 100644 --- a/sources/Game/Elinor.Party.pas +++ b/sources/Game/Elinor.Party.pas @@ -737,7 +737,7 @@ procedure TParty.TakeDamage(const ADamage: Integer; const APosition: TPosition); if (LDamage > 0) then HitPoints.ModifyCurrValue(-LDamage) else - Game.MediaPlayer.PlaySound(mmBlock); + Game.MediaPlayer.PlaySound('block'); end; end; end; @@ -780,7 +780,7 @@ procedure TParty.UpdateLevel(const APosition: TPosition); if IsMaxLevel then Exit; Experience := 0; - Game.MediaPlayer.PlaySound(mmLevel); + Game.MediaPlayer.PlaySound('level'); LMaxHitPoints := EnsureRange(HitPoints.GetMaxValue + (HitPoints.GetMaxValue div 10), 25, 1000); @@ -901,48 +901,48 @@ procedure TLeaderParty.Quaff(const AItemIndex: Integer; procedure HealCreature(const Amount: Integer); begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('heal'); TLeaderParty.Leader.Heal(APosition, Amount); Inventory.Clear(AItemIndex); end; procedure ReviveCreature; begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmRevive); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('revive'); TLeaderParty.Leader.Revive(APosition); Inventory.Clear(AItemIndex); end; procedure IncreaseDamageTemp(const APercent: Integer); begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmBoost); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('boost'); TLeaderParty.Leader.IncreaseDamageTemp(APercent, APosition); Inventory.Clear(AItemIndex); end; procedure IncreaseChancesToHitTemp(const APercent: Integer); begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmBoost); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('boost'); TLeaderParty.Leader.IncreaseChancesToHitTemp(APercent, APosition); Inventory.Clear(AItemIndex); end; procedure IncreaseHitPointsPermanently; begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmBoost); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('boost'); TLeaderParty.Leader.IncreaseHitPointsPermanently(APosition); Inventory.Clear(AItemIndex); end; procedure IncreaseChancesToHitPermanently; begin - Game.MediaPlayer.PlaySound(mmDrink); - Game.MediaPlayer.PlaySound(mmBoost); + Game.MediaPlayer.PlaySound('drink'); + Game.MediaPlayer.PlaySound('boost'); TLeaderParty.Leader.IncreaseChancesToHitPermanently(APosition); Inventory.Clear(AItemIndex); end; @@ -1219,7 +1219,7 @@ class procedure TLeaderParty.MoveUnit(AParty: TParty); begin PartyList.Party[TLeaderParty.LeaderPartyIndex].ChPosition(AParty, ActivePartyPosition, CurrentPartyPosition); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; end; @@ -1270,7 +1270,7 @@ class procedure TLeaderParty.PutAt(const AX, AY: ShortInt; begin Leader.SetLocation(AX, AY); Game.Statistics.IncValue(stTilesMoved); - Game.MediaPlayer.PlaySound(mmStep); + Game.MediaPlayer.PlaySound('step'); with TLeaderParty.Leader do begin SetLocation(AX, AY); @@ -1307,26 +1307,26 @@ class procedure TLeaderParty.PutAt(const AX, AY: ShortInt; end; reSTower: begin - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); Game.Map.UpdateRadius(Leader.X, Leader.Y, 3); F := False; end; reMageTower: begin - Game.MediaPlayer.PlayMusic(CMusicMagic); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlayMusic('magic'); + Game.MediaPlayer.PlaySound('settlement'); TSceneMageTower.ShowScene; F := False; end; reMerchantPotions: begin - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); TSceneMerchant.ShowScene(TLeaderParty.Leader, mtPotions, scMap); F := False; end; reMerchantArtifacts: begin - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); TSceneMerchant.ShowScene(TLeaderParty.Leader, mtArtifacts, scMap); F := False; end; @@ -1342,15 +1342,15 @@ class procedure TLeaderParty.PutAt(const AX, AY: ShortInt; end; if Game.Map.LeaderTile in Capitals then begin - Game.MediaPlayer.PlayMusic(CMusicGame); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlayMusic('game'); + Game.MediaPlayer.PlaySound('settlement'); TSceneSettlement.ShowScene(stCapital); F := False; end; if Game.Map.LeaderTile in Cities then begin - Game.MediaPlayer.PlayMusic(CMusicGame); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlayMusic('game'); + Game.MediaPlayer.PlaySound('settlement'); TSceneSettlement.ShowScene(stCity); F := False; end; diff --git a/sources/Game/Elinor.Resources.pas b/sources/Game/Elinor.Resources.pas index fcd378a..8fa8a6b 100644 --- a/sources/Game/Elinor.Resources.pas +++ b/sources/Game/Elinor.Resources.pas @@ -1083,180 +1083,12 @@ TResBase = record // ); -type - TMusicEnum = (mmClick, mmStep, - mmWinBattle, mmDay, mmSettlement, mmLoot, mmLevel, - mmWar, mmExit, mmSwordAttack, mmAxeAttack, mmStaffAttack, mmBowAttack, - mmSpearAttack, mmDaggerAttack, mmClubAttack, mmBlock, mmMiss, - mmNosferatAttack, mmLichQueenAttack, mmHumHit, mmHumDeath, mmGoblinHit, - mmGoblinDeath, mmSkeletonHit, mmSkeletonDeath, mmOrcHit, mmOrcDeath, - mmWolfHit, mmWolfDeath, mmWolfAttack, mmBearHit, mmBearDeath, mmBearAttack, - mmSpiderHit, mmSpiderDeath, mmSpiderAttack, mmGhostHit, mmGhostDeath, - mmGhostAttack, mmGhoulAttack, mmGhoulHit, mmGhoulDeath, mmHit, mmDeath, - mmAttack, mmGold, mmSpellbook, mmDismiss, mmPrepareMagic, mmDispell, mmHeal, - mmPlague, mmInvisibility, mmRevive, mmMana, mmSpeed, mmLearn, mmDrink, - mmUseOrb, mmImpHit, mmImpDeath, mmZombieHit, mmZombieDeath, mmZombieAttack, - mmLizardmanHit, mmLizardmanDeath, mmRaiseDead, mmRust, mmFlaskShatter, - mmExplosion, mmBoost, mmCriticalAttack); - var ResImage: array [TResEnum] of TPNGImage; CreatureResImage: array [TCreatureResEnum] of TPNGImage; SpellResImage: array [TSpellResEnum] of TPNGImage; ItemResImage: array [TItemResEnum] of TPNGImage; AbilityResImage: array [TAbilityResEnum] of TPNGImage; - ResMusicPath: array [TMusicEnum] of string; - -const - MusicBase: array [TMusicEnum] of TResBase = ( - // Click - (FileName: 'click.wav'; ResType: teSound;), - // Step - (FileName: 'step.wav'; ResType: teSound;), - // Win in battle - (FileName: 'himwar.wav'; ResType: teSound;), - // New Day - (FileName: 'day.ogg'; ResType: teSound;), - // Settlement - (FileName: 'settlement.wav'; ResType: teSound;), - // Loot - (FileName: 'loot.wav'; ResType: teSound;), - // New level - (FileName: 'level.wav'; ResType: teSound;), - // Round in battle - (FileName: 'war.wav'; ResType: teSound;), - // Exit - (FileName: 'exit.wav'; ResType: teSound;), - // Sword attack - (FileName: 'sword_attack.wav'; ResType: teSound;), - // Axe attack - (FileName: 'axe_attack.wav'; ResType: teSound;), - // Staff attack - (FileName: 'staff_attack.wav'; ResType: teSound;), - // Bow attack - (FileName: 'bow_attack.wav'; ResType: teSound;), - // Spear attack - (FileName: 'spear_attack.wav'; ResType: teSound;), - // Dagger attack - (FileName: 'dagger_attack.wav'; ResType: teSound;), - // Club attack - (FileName: 'club_attack.wav'; ResType: teSound;), - // Block - (FileName: 'block.wav'; ResType: teSound;), - // Miss - (FileName: 'miss.ogg'; ResType: teSound;), - // Nosferat Attack - (FileName: 'nosferat_attack.mp3'; ResType: teSound;), - // Lich Queen Attack - (FileName: 'lich_queen_attack.mp3'; ResType: teSound;), - // Humanoid Hit - (FileName: 'hum_hit.wav'; ResType: teSound;), - // Humanoid Death - (FileName: 'hum_death.ogg'; ResType: teSound;), - // Goblin Hit - (FileName: 'goblin_hit.wav'; ResType: teSound;), - // Goblin Death - (FileName: 'goblin_death.wav'; ResType: teSound;), - // Skeleton Hit - (FileName: 'skeleton_hit.wav'; ResType: teSound;), - // Skeleton Death - (FileName: 'skeleton_death.wav'; ResType: teSound;), - // Orc Hit - (FileName: 'orc_hit.ogg'; ResType: teSound;), - // Orc Death - (FileName: 'orc_death.ogg'; ResType: teSound;), - // Wolf Hit - (FileName: 'wolf_hit.wav'; ResType: teSound;), - // Wolf Death - (FileName: 'wolf_death.wav'; ResType: teSound;), - // Wolf Attack - (FileName: 'wolf_attack.wav'; ResType: teSound;), - // Bear Hit - (FileName: 'bear_hit.wav'; ResType: teSound;), - // Bear Death - (FileName: 'bear_death.wav'; ResType: teSound;), - // Bear Attack - (FileName: 'bear_attack.wav'; ResType: teSound;), - // Spider Hit - (FileName: 'spider_hit.wav'; ResType: teSound;), - // Spider Death - (FileName: 'spider_death.wav'; ResType: teSound;), - // Spider Attack - (FileName: 'spider_attack.wav'; ResType: teSound;), - // Ghost Hit - (FileName: 'spider_hit.wav'; ResType: teSound;), - // Ghost Death - (FileName: 'spider_death.wav'; ResType: teSound;), - // Ghost Attack - (FileName: 'spider_attack.wav'; ResType: teSound;), - // Ghoul Attack - (FileName: 'ghoul_attack.ogg'; ResType: teSound;), - // Ghoul Hit - (FileName: 'ghoul_hit.ogg'; ResType: teSound;), - // Ghoul Death - (FileName: 'ghoul_death.ogg'; ResType: teSound;), - // Hit - (FileName: 'step.wav'; ResType: teSound;), - // Death - (FileName: 'step.wav'; ResType: teSound;), - // Attack - (FileName: 'step.wav'; ResType: teSound;), - // Gold Coins - (FileName: 'coin.wav'; ResType: teSound;), - // Spellbook - (FileName: 'spellbook.mp3'; ResType: teSound;), - // Dismiss - (FileName: 'dismiss.wav'; ResType: teSound;), - // Prepare Magic - (FileName: 'prepare_magic.wav'; ResType: teSound;), - // Dispell - (FileName: 'dispell.wav'; ResType: teSound;), - // Heal - (FileName: 'heal.wav'; ResType: teSound;), - // Plague - (FileName: 'plague.wav'; ResType: teSound;), - // Invisibility - (FileName: 'invisibility.wav'; ResType: teSound;), - // Revive - (FileName: 'revive.wav'; ResType: teSound;), - // Mana - (FileName: 'mana.wav'; ResType: teSound;), - // Speed - (FileName: 'speed.wav'; ResType: teSound;), - // Learn - (FileName: 'learn.wav'; ResType: teSound;), - // Drink - (FileName: 'use_elixir.ogg'; ResType: teSound;), - // Use Orb or Talisman - (FileName: 'use_orb.ogg'; ResType: teSound;), - // Imp Hit - (FileName: 'imp_hit.ogg'; ResType: teSound;), - // Imp Death - (FileName: 'imp_death.wav'; ResType: teSound;), - // Zombie Hit - (FileName: 'zombie_hit.ogg'; ResType: teSound;), - // Zombie Death - (FileName: 'zombie_death.ogg'; ResType: teSound;), - // Zombie Attack - (FileName: 'zombie_attack.ogg'; ResType: teSound;), - // Lizardman Hit - (FileName: 'lizardman_hit.wav'; ResType: teSound;), - // Lizardman Death - (FileName: 'lizardman_death.wav'; ResType: teSound;), - // Raise Dead - (FileName: 'raise_dead.wav'; ResType: teSound;), - // Rust - (FileName: 'rust.wav'; ResType: teSound;), - // Flask Shatter - (FileName: 'flask_shatter.wav'; ResType: teSound;), - // Explosion - (FileName: 'explosion.wav'; ResType: teSound;), - // Boost - (FileName: 'boost.wav'; ResType: teSound;), - // Critical damage - (FileName: 'critical_attack.wav'; ResType: teSound;) - // - ); type TResources = class(TObject) @@ -1484,7 +1316,6 @@ class procedure TResources.ReadSections(const FileName: string; procedure Init; var LResEnum: TResEnum; - LMusicEnum: TMusicEnum; LPartyLevel: Integer; LCreatureResEnum: TCreatureResEnum; LItemResEnum: TItemResEnum; @@ -1498,17 +1329,6 @@ procedure Init; ResImage[LResEnum].LoadFromFile(TResources.GetPath('resources') + ResBase[LResEnum].FileName); end; - for LMusicEnum := Low(TMusicEnum) to High(TMusicEnum) do - begin - case MusicBase[LMusicEnum].ResType of - teSound: - ResMusicPath[LMusicEnum] := TResources.GetPath('resources\sounds') + - MusicBase[LMusicEnum].FileName; - teMusic: - ResMusicPath[LMusicEnum] := TResources.GetPath('resources\music') + - MusicBase[LMusicEnum].FileName; - end; - end; for LPartyLevel := 1 to 9 do TResources.LoadParties(Format('parties.level%d', [LPartyLevel])); for LSpellResEnum := Low(TSpellResEnum) to High(TSpellResEnum) do diff --git a/sources/Game/Elinor.Spells.Types.pas b/sources/Game/Elinor.Spells.Types.pas index 54e38d1..5206bc0 100644 --- a/sources/Game/Elinor.Spells.Types.pas +++ b/sources/Game/Elinor.Spells.Types.pas @@ -16,7 +16,7 @@ TSpellBase = record Level: Integer; Mana: Byte; RequireAbility: TAbilityEnum; - SoundEnum: TMusicEnum; + SoundEnum: string; ResEnum: TSpellResEnum; Faction: TFactionEnum; SpellTarget: TSpellTarget; diff --git a/sources/Game/Elinor.Spells.pas b/sources/Game/Elinor.Spells.pas index c01778d..f63d7ee 100644 --- a/sources/Game/Elinor.Spells.pas +++ b/sources/Game/Elinor.Spells.pas @@ -217,77 +217,77 @@ implementation const SpellBase: TSpellBaseArray = ( // None - (Name: ''; Level: 0; Mana: 0; RequireAbility: abNone; SoundEnum: mmBlock; + (Name: ''; Level: 0; Mana: 0; RequireAbility: abNone; SoundEnum: 'block'; ResEnum: srNone; Faction: faNeutrals; SpellTarget: stNone; Description: '';), // The Empire // True Healing (Name: 'True Healing'; Level: 1; Mana: 15; RequireAbility: abNone; - SoundEnum: mmHeal; ResEnum: srTrueHealing; Faction: faTheEmpire; + SoundEnum: 'heal'; ResEnum: srTrueHealing; Faction: faTheEmpire; SpellTarget: stLeader; Description: 'Replenishes lost HP';), // Speed (Name: 'Speed'; Level: 1; Mana: 25; RequireAbility: abNone; - SoundEnum: mmHeal; ResEnum: srSpeed; Faction: faTheEmpire; + SoundEnum: 'heal'; ResEnum: srSpeed; Faction: faTheEmpire; SpellTarget: stLeader; Description: '';), // Bless (Name: 'Bless'; Level: 1; Mana: 5; RequireAbility: abNone; - SoundEnum: mmHeal; ResEnum: srBless; Faction: faTheEmpire; + SoundEnum: 'heal'; ResEnum: srBless; Faction: faTheEmpire; SpellTarget: stLeader; Description: '';), // Summon: Living Armor (Name: 'Summon: Living Armor'; Level: 1; Mana: 25; RequireAbility: abNone; - SoundEnum: mmAttack; ResEnum: srLivingArmor; Faction: faTheEmpire; + SoundEnum: 'attack'; ResEnum: srLivingArmor; Faction: faTheEmpire; SpellTarget: stEnemy; Description: 'Summons a Living Armor';), // Summon: Stone Golem (Name: 'Summon: Stone Golem'; Level: 1; Mana: 40; - RequireAbility: abGolemMastery; SoundEnum: mmRaiseDead; + RequireAbility: abGolemMastery; SoundEnum: 'raise_dead'; ResEnum: srStoneGolem; Faction: faTheEmpire; SpellTarget: stEnemy; Description: 'Summons a Stone Golem';), // Eagle Eye (Name: 'Eagle Eye'; Level: 1; Mana: 5; RequireAbility: abNone; - SoundEnum: mmHeal; ResEnum: srEagleEye; Faction: faTheEmpire; + SoundEnum: 'heal'; ResEnum: srEagleEye; Faction: faTheEmpire; SpellTarget: stLeader; Description: 'Allows the leader to see further';), // Strength (Name: 'Strength'; Level: 1; Mana: 5; RequireAbility: abNone; - SoundEnum: mmHeal; ResEnum: srStrength; Faction: faTheEmpire; + SoundEnum: 'heal'; ResEnum: srStrength; Faction: faTheEmpire; SpellTarget: stLeader; Description: 'Increases damage by 20%';), // Undead Hordes // Plague (Name: 'Plague'; Level: 1; Mana: 20; RequireAbility: abNone; - SoundEnum: mmPlague; ResEnum: srPlague; Faction: faUndeadHordes; + SoundEnum: 'plague'; ResEnum: srPlague; Faction: faUndeadHordes; SpellTarget: stEnemy; Description: '';), // Curse (Name: 'Curse'; Level: 1; Mana: 5; RequireAbility: abNone; - SoundEnum: mmPlague; ResEnum: srCurse; Faction: faUndeadHordes; + SoundEnum: 'plague'; ResEnum: srCurse; Faction: faUndeadHordes; SpellTarget: stEnemy; Description: '';), // Summon: Skeleton Warrior (Name: 'Summon: Skeleton Warrior'; Level: 1; Mana: 25; - RequireAbility: abNone; SoundEnum: mmRaiseDead; ResEnum: srSkeletion; + RequireAbility: abNone; SoundEnum: 'raise_dead'; ResEnum: srSkeletion; Faction: faUndeadHordes; SpellTarget: stEnemy; Description: 'Summons a Skeleton';), // Summon: Bone Golem (Name: 'Summon: Bone Golem'; Level: 1; Mana: 45; - RequireAbility: abGolemMastery; SoundEnum: mmRaiseDead; + RequireAbility: abGolemMastery; SoundEnum: 'raise_dead'; ResEnum: srBoneGolem; Faction: faUndeadHordes; SpellTarget: stEnemy; Description: 'Summons a Bone Golem';), // Legions of the Damned // Concealment (Name: 'Concealment'; Level: 1; Mana: 20; RequireAbility: abNone; - SoundEnum: mmInvisibility; ResEnum: srConcealment; + SoundEnum: 'invisibility'; ResEnum: srConcealment; Faction: faLegionsOfTheDamned; SpellTarget: stLeader; Description: '';), // Chains Of Dread (Name: 'Chains of Dread'; Level: 1; Mana: 2; RequireAbility: abNone; - SoundEnum: mmInvisibility; ResEnum: srChainsOfDread; + SoundEnum: 'invisibility'; ResEnum: srChainsOfDread; Faction: faLegionsOfTheDamned; SpellTarget: stEnemy; Description: '';), // Weaken (Name: 'Weaken'; Level: 1; Mana: 2; RequireAbility: abNone; - SoundEnum: mmInvisibility; ResEnum: srWeaken; Faction: faLegionsOfTheDamned; + SoundEnum:'invisibility'; ResEnum: srWeaken; Faction: faLegionsOfTheDamned; SpellTarget: stEnemy; Description: '';), // Summon: Fire Golem (Name: 'Summon: Fire Golem'; Level: 1; Mana: 42; - RequireAbility: abGolemMastery; SoundEnum: mmRaiseDead; + RequireAbility: abGolemMastery; SoundEnum: 'raise_dead'; ResEnum: srFireGolem; Faction: faLegionsOfTheDamned; SpellTarget: stEnemy; Description: 'Summons a Fire Golem';) // @@ -349,7 +349,7 @@ procedure TSpell.PlaySpellEffects; procedure TActiveSpell.Clear; begin - Game.MediaPlayer.PlaySound(mmDispell); + Game.MediaPlayer.PlaySound('dispell'); FSpellEnum := spNone; end; @@ -415,7 +415,7 @@ procedure TSpells.Learn(const ASpellEnum: TSpellEnum); if not FLearned[ASpellEnum] then begin FLearned[ASpellEnum] := True; - Game.MediaPlayer.PlaySound(mmDispell); + Game.MediaPlayer.PlaySound('dispell'); end end; diff --git a/sources/Scenes/DisciplesRL.Scene.Hire.pas b/sources/Scenes/DisciplesRL.Scene.Hire.pas index e6ddd04..3b20955 100644 --- a/sources/Scenes/DisciplesRL.Scene.Hire.pas +++ b/sources/Scenes/DisciplesRL.Scene.Hire.pas @@ -139,7 +139,7 @@ class function TSceneHire.HireIndex: Integer; procedure TSceneHire.Back; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); case SubScene of stSpy, stWar: Game.Show(scMap); @@ -196,7 +196,7 @@ procedure TSceneHire.Ok; end; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); case SubScene of stSpy: begin diff --git a/sources/Scenes/Elinor.Scene.Abilities.pas b/sources/Scenes/Elinor.Scene.Abilities.pas index e356320..fe91fc7 100644 --- a/sources/Scenes/Elinor.Scene.Abilities.pas +++ b/sources/Scenes/Elinor.Scene.Abilities.pas @@ -77,8 +77,8 @@ destructor TSceneAbilities.Destroy; class procedure TSceneAbilities.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(CloseSceneEnum); end; @@ -172,7 +172,7 @@ procedure TSceneAbilities.Render; class procedure TSceneAbilities.ShowScene(const ACloseSceneEnum: TSceneEnum); begin CloseSceneEnum := ACloseSceneEnum; - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(scAbilities); ActivePartyPosition := TLeaderParty.GetPosition; end; diff --git a/sources/Scenes/Elinor.Scene.Barracks.pas b/sources/Scenes/Elinor.Scene.Barracks.pas index 19be93e..b65518d 100644 --- a/sources/Scenes/Elinor.Scene.Barracks.pas +++ b/sources/Scenes/Elinor.Scene.Barracks.pas @@ -72,13 +72,13 @@ class procedure TSceneBarracks.ShowScene(AParty: TParty); else ActivePartyPosition := AParty.GetRandomPosition; Game.Show(scBarracks); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; class procedure TSceneBarracks.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(scSettlement); end; @@ -140,7 +140,7 @@ procedure TSceneBarracks.ShowRecruitScene; end; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); RecruitIt(CurrentParty, ActivePartyPosition); end; @@ -178,7 +178,7 @@ procedure TSceneBarracks.MouseMove(Shift: TShiftState; X, Y: Integer); procedure TSceneBarracks.ShowPartyScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneParty2.ShowScene(CurrentParty, scBarracks); end; @@ -246,14 +246,14 @@ procedure TSceneBarracks.Dismiss; end; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); DismissIt(CurrentParty, ActivePartyPosition); end; procedure TSceneBarracks.DismissCreature; begin if ConfirmParty.Dismiss(ConfirmPartyPosition) then - Game.MediaPlayer.PlaySound(mmDismiss); + Game.MediaPlayer.PlaySound('dismiss'); end; procedure TSceneBarracks.Timer; diff --git a/sources/Scenes/Elinor.Scene.Base.Party.pas b/sources/Scenes/Elinor.Scene.Base.Party.pas index 02b2a13..29283df 100644 --- a/sources/Scenes/Elinor.Scene.Base.Party.pas +++ b/sources/Scenes/Elinor.Scene.Base.Party.pas @@ -53,7 +53,7 @@ procedure TSceneBaseParty.MoveCursor(const AArrowKeyDirectionEnum begin ActivePartyPosition := PositionTransitions[AArrowKeyDirectionEnum, ActivePartyPosition]; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Render; end; diff --git a/sources/Scenes/Elinor.Scene.Battle2.pas b/sources/Scenes/Elinor.Scene.Battle2.pas index fe8c384..4f753b2 100644 --- a/sources/Scenes/Elinor.Scene.Battle2.pas +++ b/sources/Scenes/Elinor.Scene.Battle2.pas @@ -230,13 +230,13 @@ procedure TSceneBattle2.ChCond; begin FBattle.BattleLog.WinInBattle; ChExperience; - Game.MediaPlayer.PlaySound(mmWinBattle); - Game.MediaPlayer.PlayMusic(CMusicBattleWin); + Game.MediaPlayer.PlaySound('battle_win'); + Game.MediaPlayer.PlayMusic('battle_win'); end; if LeaderParty.IsClear then begin FBattle.BattleLog.LoseInBattle; - Game.MediaPlayer.PlayMusic(CMusicDefeat); + Game.MediaPlayer.PlayMusic('defeat'); Enabled := True; end; end; @@ -314,7 +314,7 @@ procedure TSceneBattle2.Victory; InformDialog ('Вы победили на дуэли и воины вражеского отряда разбежались!'); end; - Game.MediaPlayer.PlayMusic(CMusicMap); + Game.MediaPlayer.PlayMusic('map'); PartyList.Party[PartyList.GetPartyIndex(TLeaderParty.Leader.X, TLeaderParty.Leader.Y)].Clear; if IsNewAbility then @@ -337,7 +337,7 @@ procedure TSceneBattle2.Defeat; if IsSummon then begin IsSummon := False; - Game.MediaPlayer.PlayMusic(CMusicMap); + Game.MediaPlayer.PlayMusic('map'); Game.Show(scMap); Exit; end; @@ -389,7 +389,7 @@ procedure TSceneBattle2.StartBattle; ActivePartyPosition := PartyList.Party[TLeaderParty.LeaderPartyIndex] .GetRandomPosition; CurrentPartyPosition := ActivePartyPosition; - Game.MediaPlayer.PlaySound(mmWar); + Game.MediaPlayer.PlaySound('battle_round'); StartRound; except on E: Exception do @@ -440,7 +440,7 @@ procedure TSceneBattle2.Turn(const ATurnType: TTurnType; begin FBattle.BattleLog.Miss(AAtkParty.Creature[AAtkPos].Name[0], ADefParty.Creature[ADefPos].Name[1]); - Game.MediaPlayer.PlaySound(mmMiss); + Game.MediaPlayer.PlaySound('miss'); Sleep(200); NextTurn; Exit; @@ -604,7 +604,7 @@ procedure TSceneBattle2.Heal(AParty: TParty; AAtkPos, ADefPos: TPosition); if Alive and (HitPoints.GetCurrValue < HitPoints.GetMaxValue) then begin - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('heal'); AParty.Heal(LPosition, AParty.Creature[AAtkPos].Heal); FBattle.BattleLog.Heal(AParty.Creature[AAtkPos].Name[0], AParty.Creature[LPosition].Name[1], @@ -631,7 +631,7 @@ procedure TSceneBattle2.Heal(AParty: TParty; AAtkPos, ADefPos: TPosition); procedure TSceneBattle2.HideBattleLog; begin FIsShowBattleLog := False; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; class procedure TSceneBattle2.HideScene; @@ -1038,13 +1038,13 @@ procedure TSceneBattle2.Show(const ASceneEnum: TSceneEnum); IsNewAbility := False; FIsShowBattleLog := False; StartBattle; - Game.MediaPlayer.PlayMusic(CMusicBattle); + Game.MediaPlayer.PlayMusic('battle'); end; procedure TSceneBattle2.ShowBattleLog; begin FIsShowBattleLog := True; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; class procedure TSceneBattle2.ShowScene; @@ -1154,7 +1154,7 @@ procedure TSceneBattle2.UseLHandItem; case LItem.Enum of iTalismanOfRestoration: begin - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('heal'); LeaderParty.Heal(LLeaderPosition, 55); FBattle.BattleLog.Log.Add (LStr + ' The Talisman heals the Leader.'); @@ -1164,7 +1164,7 @@ procedure TSceneBattle2.UseLHandItem; end; iTalismanOfVigor: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); LDamage := LeaderParty.Creature[LLeaderPosition] .Damage.GetFullValue; LDamage := EnsureRange(LDamage div 4, 1, 75); @@ -1177,7 +1177,7 @@ procedure TSceneBattle2.UseLHandItem; end; iTalismanOfProtection: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); LArmor := LeaderParty.Creature[LLeaderPosition] .Armor.GetFullValue; LArmor := EnsureRange(LArmor div 10, 1, 100); @@ -1190,7 +1190,7 @@ procedure TSceneBattle2.UseLHandItem; end; iTalismanOfCelerity: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); LInitiative := LeaderParty.Creature[LLeaderPosition] .Initiative.GetFullValue; LInitiative := EnsureRange(LInitiative div 5, 1, 80); @@ -1204,14 +1204,14 @@ procedure TSceneBattle2.UseLHandItem; iTalismanOfNosferat, iTalismanOfFear, iOrbOfWitches, iAcidFlask, iFlaskOfOil: begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneSelectUnit.ShowScene(EnemyParty); Exit; end; iTalismanOfRage, iGoblinOrb, iOrbOfHealing, iImpOrb, iSkeletonOrb, iOrbOfRestoration, iZombieOrb, iOrbOfLife, iLizardmanOrb: begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneSelectUnit.ShowScene(LeaderParty); Exit; end; diff --git a/sources/Scenes/Elinor.Scene.Battle3.pas b/sources/Scenes/Elinor.Scene.Battle3.pas index 103ed20..6a67c4d 100644 --- a/sources/Scenes/Elinor.Scene.Battle3.pas +++ b/sources/Scenes/Elinor.Scene.Battle3.pas @@ -41,7 +41,7 @@ implementation procedure TSceneBattle3.Start; begin - Game.MediaPlayer.PlaySound(mmWar); + Game.MediaPlayer.PlaySound('battle_round'); end; procedure TSceneBattle3.Finish; @@ -92,7 +92,7 @@ procedure TSceneBattle3.Show(const S: TSceneEnum); begin inherited; Start; - Game.MediaPlayer.PlayMusic(CMusicBattle); + Game.MediaPlayer.PlayMusic('battle'); end; procedure TSceneBattle3.Timer; diff --git a/sources/Scenes/Elinor.Scene.Defeat.pas b/sources/Scenes/Elinor.Scene.Defeat.pas index 8490be9..85a5439 100644 --- a/sources/Scenes/Elinor.Scene.Defeat.pas +++ b/sources/Scenes/Elinor.Scene.Defeat.pas @@ -56,8 +56,8 @@ class procedure TSceneDefeat.ShowScene; class procedure TSceneDefeat.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlayMusic(CMusicMenu); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlayMusic('menu'); Game.IsGame := False; Game.LeaderRecordsTable.AddRecord(TCreature.GetName, TLeaderParty.Leader.Owner, TLeaderParty.Leader.LeaderClass, diff --git a/sources/Scenes/Elinor.Scene.Difficulty.pas b/sources/Scenes/Elinor.Scene.Difficulty.pas index 1d36452..b0b1832 100644 --- a/sources/Scenes/Elinor.Scene.Difficulty.pas +++ b/sources/Scenes/Elinor.Scene.Difficulty.pas @@ -110,7 +110,7 @@ procedure TSceneDifficulty.Render; class procedure TSceneDifficulty.Show; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scDifficulty); end; diff --git a/sources/Scenes/Elinor.Scene.Faction.pas b/sources/Scenes/Elinor.Scene.Faction.pas index 6b31306..be5b63a 100644 --- a/sources/Scenes/Elinor.Scene.Faction.pas +++ b/sources/Scenes/Elinor.Scene.Faction.pas @@ -91,7 +91,7 @@ procedure TSceneRace.Render; class procedure TSceneRace.ShowScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scRace); end; diff --git a/sources/Scenes/Elinor.Scene.Inventory.pas b/sources/Scenes/Elinor.Scene.Inventory.pas index 0a4a289..69f045a 100644 --- a/sources/Scenes/Elinor.Scene.Inventory.pas +++ b/sources/Scenes/Elinor.Scene.Inventory.pas @@ -113,13 +113,13 @@ class procedure TSceneInventory.ShowScene(AParty: TParty; ActivePartyPosition := AParty.GetRandomPosition; ActiveSection := isParty; Game.Show(scInventory); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; class procedure TSceneInventory.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(CloseSceneEnum); end; diff --git a/sources/Scenes/Elinor.Scene.Leader.pas b/sources/Scenes/Elinor.Scene.Leader.pas index 5f39fe8..408e860 100644 --- a/sources/Scenes/Elinor.Scene.Leader.pas +++ b/sources/Scenes/Elinor.Scene.Leader.pas @@ -55,7 +55,7 @@ procedure TSceneLeader.Continue; inherited; if CurrentIndex > 4 then Exit; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneHire.CurCrAbilityEnum := TCreature.Character(CurCrEnum).AbilityEnum; Game.Clear; PartyList.Party[TLeaderParty.LeaderPartyIndex].Owner := Game.Scenario.Faction; @@ -129,7 +129,7 @@ procedure TSceneLeader.Render; class procedure TSceneLeader.Show; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scLeader); end; diff --git a/sources/Scenes/Elinor.Scene.Loot2.pas b/sources/Scenes/Elinor.Scene.Loot2.pas index dd8d5aa..c9f79b0 100644 --- a/sources/Scenes/Elinor.Scene.Loot2.pas +++ b/sources/Scenes/Elinor.Scene.Loot2.pas @@ -99,19 +99,19 @@ procedure TSceneLoot2.PickupItem; case LLootItem.LootType of ltGold: begin - Game.MediaPlayer.PlaySound(mmGold); + Game.MediaPlayer.PlaySound('gold'); Game.Gold.Modify(LLootItem.Amount); Loot.Clear(LItemIndex); end; ltMana: begin - Game.MediaPlayer.PlaySound(mmMana); + Game.MediaPlayer.PlaySound('mana'); Game.Mana.Modify(LLootItem.Amount); Loot.Clear(LItemIndex); end; ltStoneTab: begin - Game.MediaPlayer.PlaySound(mmLoot); + Game.MediaPlayer.PlaySound('loot'); Inc(Game.Scenario.StoneTab); Loot.Clear(LItemIndex); InformDialog(Game.Scenario.ScenarioAncientKnowledgeState); @@ -123,7 +123,7 @@ procedure TSceneLoot2.PickupItem; InformDialog(CNoFreeSpace); Exit; end; - Game.MediaPlayer.PlaySound(mmLoot); + Game.MediaPlayer.PlaySound('loot'); TLeaderParty.Leader.Inventory.Add(LLootItem.ItemEnum); Game.Statistics.IncValue(stItemsFound); Loot.Clear(LItemIndex); @@ -155,8 +155,8 @@ class procedure TSceneLoot2.HideScene; Exit; end; Game.Show(scMap); - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmLoot); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('loot'); end; constructor TSceneLoot2.Create; @@ -333,7 +333,7 @@ procedure TSceneLoot2.Render; class procedure TSceneLoot2.ShowScene; begin ActiveSection := lsLoot; - Game.MediaPlayer.PlaySound(mmLoot); + Game.MediaPlayer.PlaySound('loot'); Game.Show(scLoot); end; diff --git a/sources/Scenes/Elinor.Scene.MageTower.pas b/sources/Scenes/Elinor.Scene.MageTower.pas index 97c0368..87a828a 100644 --- a/sources/Scenes/Elinor.Scene.MageTower.pas +++ b/sources/Scenes/Elinor.Scene.MageTower.pas @@ -77,17 +77,17 @@ procedure TSceneMageTower.TryLearnSpell; LGold := 0; if LGold > Game.Gold.Value then begin - Game.MediaPlayer.PlaySound(mmSpellbook); + Game.MediaPlayer.PlaySound('spellbook'); InformDialog(CNotEnoughGoldToLearn); Exit; end; if LMana > Game.Mana.Value then begin - Game.MediaPlayer.PlaySound(mmSpellbook); + Game.MediaPlayer.PlaySound('spellbook'); InformDialog(CNotEnoughManaToLearn); Exit; end; - Game.MediaPlayer.PlaySound(mmLearn); + Game.MediaPlayer.PlaySound('learn'); Game.Gold.Modify(-LGold); Game.Mana.Modify(-LMana); Spells.Learn(LSpellEnum); @@ -97,9 +97,9 @@ procedure TSceneMageTower.TryLearnSpell; class procedure TSceneMageTower.HideScene; begin - Game.MediaPlayer.PlayMusic(CMusicMap); + Game.MediaPlayer.PlayMusic('map'); Game.Show(scMap); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; constructor TSceneMageTower.Create; @@ -232,7 +232,7 @@ procedure TSceneMageTower.Render; class procedure TSceneMageTower.ShowScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scMageTower); end; diff --git a/sources/Scenes/Elinor.Scene.Map.pas b/sources/Scenes/Elinor.Scene.Map.pas index 75d0010..dcd9b48 100644 --- a/sources/Scenes/Elinor.Scene.Map.pas +++ b/sources/Scenes/Elinor.Scene.Map.pas @@ -74,9 +74,9 @@ procedure TSceneMap.Escape; Spells.ActiveSpell.Clear(); Exit; end; - Game.MediaPlayer.PlayMusic(CMusicMenu); - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlayMusic('menu'); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); TSceneMenu3(Game.GetScene(scMenu)).CurrentIndex := 1; Game.Show(scMenu); end; @@ -311,7 +311,7 @@ procedure TSceneMap.Render; procedure TSceneMap.Show(const S: TSceneEnum); begin inherited Show(S); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; procedure TSceneMap.Timer; diff --git a/sources/Scenes/Elinor.Scene.Menu.Simple.pas b/sources/Scenes/Elinor.Scene.Menu.Simple.pas index dfc7264..ce33022 100644 --- a/sources/Scenes/Elinor.Scene.Menu.Simple.pas +++ b/sources/Scenes/Elinor.Scene.Menu.Simple.pas @@ -126,7 +126,7 @@ procedure TSceneSimpleMenu.MouseDown(AButton: TMouseButton; Shift: TShiftState; if MouseOver(TFrame.Col(1), TFrame.Row(I), X, Y) and not IsBlockFrames then begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); CurrentIndex := I; Break; end; @@ -191,7 +191,7 @@ procedure TSceneSimpleMenu.UpdateEnum(AKey: Word); Basic(AKey); if not(AKey in [K_UP, K_Down]) then Exit; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); LCycler := TEnumCycler.Create(CurrentIndex); CurrentIndex := LCycler.Modify(AKey = K_Down); end; diff --git a/sources/Scenes/Elinor.Scene.Menu.Wide.pas b/sources/Scenes/Elinor.Scene.Menu.Wide.pas index c904cf4..e8fa7d7 100644 --- a/sources/Scenes/Elinor.Scene.Menu.Wide.pas +++ b/sources/Scenes/Elinor.Scene.Menu.Wide.pas @@ -63,7 +63,7 @@ procedure TSceneWideMenu.MoveCursor(const AArrowKeyDirectionEnum : TArrowKeyDirectionEnum); begin CurrentIndex := PositionTransitions[AArrowKeyDirectionEnum, CurrentIndex]; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Render; end; @@ -146,7 +146,7 @@ procedure TSceneWideMenu.MouseDown(AButton: TMouseButton; Shift: TShiftState; if not IsBlockFrames then begin CurrentIndex := LPartyPosition; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Exit; end; end; diff --git a/sources/Scenes/Elinor.Scene.Menu3.pas b/sources/Scenes/Elinor.Scene.Menu3.pas index b7e3227..b025a19 100644 --- a/sources/Scenes/Elinor.Scene.Menu3.pas +++ b/sources/Scenes/Elinor.Scene.Menu3.pas @@ -124,7 +124,7 @@ procedure TSceneMenu3.ContinueGame; begin if Game.IsGame then begin - Game.MediaPlayer.PlayMusic(CMusicMap); + Game.MediaPlayer.PlayMusic('map'); Game.Show(scMap); end; end; @@ -174,7 +174,7 @@ procedure TSceneMenu3.MouseDown(AButton: TMouseButton; Shift: TShiftState; 0 .. 5: begin CurrentIndex := LPartyPosition; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Exit; end; end; diff --git a/sources/Scenes/Elinor.Scene.Merchant.pas b/sources/Scenes/Elinor.Scene.Merchant.pas index bf13c0e..dc6a923 100644 --- a/sources/Scenes/Elinor.Scene.Merchant.pas +++ b/sources/Scenes/Elinor.Scene.Merchant.pas @@ -79,13 +79,13 @@ class procedure TSceneMerchant.ShowScene(AParty: TParty; ActiveSection := isMerchant; GetMerchantItemPrice; Game.Show(scMerchant); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; class procedure TSceneMerchant.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(CloseSceneEnum); end; @@ -113,7 +113,7 @@ procedure TSceneMerchant.BuyItem; TLeaderParty.Leader.Inventory.Add(LItem); Merchants.GetMerchant(CurrentMerchantType) .Inventory.Clear(MerchantSelItemIndex); - Game.MediaPlayer.PlaySound(mmGold); + Game.MediaPlayer.PlaySound('gold'); Render; end; @@ -134,7 +134,7 @@ procedure TSceneMerchant.SellItem; Game.Gold.Modify(LPrice); Merchants.GetMerchant(CurrentMerchantType).ModifyGold(-LPrice); TLeaderParty.Leader.Inventory.Clear(InventorySelItemIndex); - Game.MediaPlayer.PlaySound(mmGold); + Game.MediaPlayer.PlaySound('gold'); Render; end; diff --git a/sources/Scenes/Elinor.Scene.Name.pas b/sources/Scenes/Elinor.Scene.Name.pas index dfa562e..def6ced 100644 --- a/sources/Scenes/Elinor.Scene.Name.pas +++ b/sources/Scenes/Elinor.Scene.Name.pas @@ -228,7 +228,7 @@ procedure TSceneName.GenerateRandomName; FNewName := GetRandomNameForFaction(AllFactionNames, GetLeaderFaction, GetLeaderGender); CursorPosition := Length(FNewName); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; function TSceneName.GetLeaderFaction: TFactionEnum; @@ -244,15 +244,15 @@ function TSceneName.GetLeaderGender: TCreatureGender; class procedure TSceneName.ShowScene; begin TSceneName(Game.GetScene(scName)).GenerateRandomName; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scName); end; class procedure TSceneName.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlayMusic(CMusicGame); - Game.MediaPlayer.PlaySound(mmExit); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlayMusic('game'); + Game.MediaPlayer.PlaySound('exit'); TSceneSettlement.ShowScene(stCapital); end; diff --git a/sources/Scenes/Elinor.Scene.NewAbility.pas b/sources/Scenes/Elinor.Scene.NewAbility.pas index 7774824..0829afd 100644 --- a/sources/Scenes/Elinor.Scene.NewAbility.pas +++ b/sources/Scenes/Elinor.Scene.NewAbility.pas @@ -78,7 +78,7 @@ destructor TSceneNewAbility.Destroy; class procedure TSceneNewAbility.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneBattle2.AfterVictory; end; @@ -193,7 +193,7 @@ procedure TSceneNewAbility.Render; class procedure TSceneNewAbility.ShowScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scNewAbility); end; diff --git a/sources/Scenes/Elinor.Scene.Party2.pas b/sources/Scenes/Elinor.Scene.Party2.pas index 4f761f1..af457c8 100644 --- a/sources/Scenes/Elinor.Scene.Party2.pas +++ b/sources/Scenes/Elinor.Scene.Party2.pas @@ -71,7 +71,7 @@ class procedure TSceneParty2.Show(Party: TParty; CloseScene: TSceneEnum); BackScene := CloseScene; ActivePartyPosition := Party.GetRandomPosition; Game.Show(scParty); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; procedure TSceneParty2.ShowAbilitiesScene; @@ -224,7 +224,7 @@ class procedure TSceneParty2.ShowScene(AParty: TParty; else ActivePartyPosition := AParty.GetRandomPosition; Game.Show(scParty); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; procedure TSceneParty2.ShowSpellbookScene; @@ -235,8 +235,8 @@ procedure TSceneParty2.ShowSpellbookScene; class procedure TSceneParty2.HideScene; begin Game.Show(CloseScene); - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); end; procedure TSceneParty2.Timer; diff --git a/sources/Scenes/Elinor.Scene.Records.pas b/sources/Scenes/Elinor.Scene.Records.pas index 8cd01e8..d5fbb36 100644 --- a/sources/Scenes/Elinor.Scene.Records.pas +++ b/sources/Scenes/Elinor.Scene.Records.pas @@ -59,7 +59,7 @@ procedure TSceneRecords.MoveCursor(const AArrowKeyDirectionEnum : TArrowKeyDirectionEnum); begin CurrentIndex := PositionTransitions[AArrowKeyDirectionEnum, CurrentIndex]; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Render; end; @@ -104,7 +104,7 @@ procedure TSceneRecords.FilterByFaction; class procedure TSceneRecords.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scMenu); end; @@ -122,7 +122,7 @@ procedure TSceneRecords.MouseDown(AButton: TMouseButton; Shift: TShiftState; 0 .. 5: begin CurrentIndex := LPartyPosition; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Exit; end; end; @@ -270,7 +270,7 @@ procedure TSceneRecords.Render; class procedure TSceneRecords.ShowScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scRecords); end; diff --git a/sources/Scenes/Elinor.Scene.Recruit.pas b/sources/Scenes/Elinor.Scene.Recruit.pas index 126e9b8..5f61ea7 100644 --- a/sources/Scenes/Elinor.Scene.Recruit.pas +++ b/sources/Scenes/Elinor.Scene.Recruit.pas @@ -79,8 +79,8 @@ destructor TSceneRecruit.Destroy; class procedure TSceneRecruit.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(scBarracks); end; @@ -94,7 +94,7 @@ procedure TSceneRecruit.Recruit; Exit; if HireParty.Hire(LCreatureEnum, HirePosition) then begin - Game.MediaPlayer.PlaySound(mmGold); + Game.MediaPlayer.PlaySound('gold'); Game.Show(scBarracks); end else diff --git a/sources/Scenes/Elinor.Scene.Scenario.pas b/sources/Scenes/Elinor.Scene.Scenario.pas index 24b63ab..607eec6 100644 --- a/sources/Scenes/Elinor.Scene.Scenario.pas +++ b/sources/Scenes/Elinor.Scene.Scenario.pas @@ -125,7 +125,7 @@ procedure TSceneScenario.Render; class procedure TSceneScenario.Show; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Show(scScenario); end; diff --git a/sources/Scenes/Elinor.Scene.SelectUnit.pas b/sources/Scenes/Elinor.Scene.SelectUnit.pas index 73303ad..fdee8f6 100644 --- a/sources/Scenes/Elinor.Scene.SelectUnit.pas +++ b/sources/Scenes/Elinor.Scene.SelectUnit.pas @@ -67,7 +67,7 @@ class procedure TSceneSelectUnit.ShowScene(AParty: TParty); class procedure TSceneSelectUnit.HideScene; begin ActivePartyPosition := LastActivePartyPosition; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.BackToScene(scBattle); end; @@ -200,7 +200,7 @@ procedure TSceneSelectUnit.SelectUnit; case LItem.Enum of iTalismanOfNosferat: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); CurrentParty.TakeDamage(25, ActivePartyPosition); TLeaderParty.Leader.UpdateHP(25, TLeaderParty.GetPosition); PendingItemLogString := Format(CYouUsedTheItem, @@ -209,7 +209,7 @@ procedure TSceneSelectUnit.SelectUnit; end; iTalismanOfFear: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); CurrentParty.Paralyze(ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + Format(' Paralyzes the %s.', @@ -217,40 +217,40 @@ procedure TSceneSelectUnit.SelectUnit; end; iTalismanOfRage: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + ' Gives an extra attack!'; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneBattle2(Game.GetScene(scBattle)).ContinueBattle(False); Game.BackToScene(scBattle); Exit; end; iOrbOfHealing: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); CurrentParty.UpdateHP(50, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + ' Healed for 50 hp.'; end; iOrbOfRestoration: begin - Game.MediaPlayer.PlaySound(mmUseOrb); + Game.MediaPlayer.PlaySound('use_orb'); CurrentParty.UpdateHP(100, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + ' Healed for 100 hp.'; end; iOrbOfLife: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmRevive); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('revive'); CurrentParty.Revive(ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + ' You resurrected the creature.'; end; iGoblinOrb: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmGoblinHit); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('goblin_hit'); CurrentParty.AddCreature(crGoblin, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -258,8 +258,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iImpOrb: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmImpHit); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('imp_hit'); CurrentParty.AddCreature(crImp, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -267,8 +267,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iSkeletonOrb: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmRaiseDead); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('raise_dead'); CurrentParty.AddCreature(crSkeletonWarrior, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -276,8 +276,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iZombieOrb: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmZombieHit); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('zombie_hit'); CurrentParty.AddCreature(crZombie, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -285,8 +285,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iLizardmanOrb: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmLizardmanHit); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('lizardman_hit'); CurrentParty.AddCreature(crLizardman, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -294,8 +294,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iOrbOfWitches: begin - Game.MediaPlayer.PlaySound(mmUseOrb); - Game.MediaPlayer.PlaySound(mmImpHit); + Game.MediaPlayer.PlaySound('use_orb'); + Game.MediaPlayer.PlaySound('imp_hit'); CurrentParty.Dismiss(ActivePartyPosition); CurrentParty.AddCreature(crImp, ActivePartyPosition); PendingItemLogString := Format(CYouUsedTheItem, @@ -304,8 +304,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iAcidFlask: begin - Game.MediaPlayer.PlaySound(mmFlaskShatter); - Game.MediaPlayer.PlaySound(mmRust); + Game.MediaPlayer.PlaySound('flask_shatter'); + Game.MediaPlayer.PlaySound('rust'); CurrentParty.ReduceArmor(50, ActivePartyPosition); PendingItemLogString := Format(CYouThrewTheItem, [TItemBase.Item(LItem.Enum).Name]) + @@ -313,8 +313,8 @@ procedure TSceneSelectUnit.SelectUnit; end; iFlaskOfOil: begin - Game.MediaPlayer.PlaySound(mmFlaskShatter); - Game.MediaPlayer.PlaySound(mmExplosion); + Game.MediaPlayer.PlaySound('flask_shatter'); + Game.MediaPlayer.PlaySound('explosion'); CurrentParty.Explosion(25, ActivePartyPosition); LLogStr := ''; with TCreature.Character(CurrentParty.Creature @@ -338,7 +338,7 @@ procedure TSceneSelectUnit.SelectUnit; end; end; ActivePartyPosition := LastActivePartyPosition; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneBattle2(Game.GetScene(scBattle)).ContinueBattle(True); Game.BackToScene(scBattle); end; diff --git a/sources/Scenes/Elinor.Scene.Settlement.pas b/sources/Scenes/Elinor.Scene.Settlement.pas index f1e5f5c..4289c94 100644 --- a/sources/Scenes/Elinor.Scene.Settlement.pas +++ b/sources/Scenes/Elinor.Scene.Settlement.pas @@ -86,7 +86,7 @@ procedure TSceneSettlement.MoveCursor(const AArrowKeyDirectionEnum begin ActivePartyPosition := PositionTransitions[AArrowKeyDirectionEnum, ActivePartyPosition]; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.Render; end; @@ -108,9 +108,9 @@ class procedure TSceneSettlement.HideScene; Exit; end; end; - Game.MediaPlayer.PlayMusic(CMusicMap); + Game.MediaPlayer.PlayMusic('map'); Game.Show(scMap); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.NewDay; end; @@ -185,7 +185,7 @@ procedure TSceneSettlement.MouseDown(AButton: TMouseButton; Shift: TShiftState; ActivePartyPosition := CurrentPartyPosition; end; end; - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; end; end; @@ -269,13 +269,13 @@ procedure TSceneSettlement.ShowTempleScene; 0 .. 5: begin TSceneTemple.ShowScene(TLeaderParty.Leader); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end else if not SettlementParty.IsClear then begin TSceneTemple.ShowScene(SettlementParty); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; end; end; @@ -286,13 +286,13 @@ procedure TSceneSettlement.ShowBarracksScene; 0 .. 5: begin TSceneBarracks.ShowScene(TLeaderParty.Leader); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end else if not SettlementParty.IsClear then begin TSceneBarracks.ShowScene(SettlementParty); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; end; @@ -305,13 +305,13 @@ procedure TSceneSettlement.ShowPartyScene; begin TSceneParty2.ShowScene(PartyList.Party[TLeaderParty.LeaderPartyIndex], scSettlement); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end else if not SettlementParty.IsClear then begin TSceneParty2.ShowScene(SettlementParty, scSettlement); - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); end; end; end; diff --git a/sources/Scenes/Elinor.Scene.Spellbook.pas b/sources/Scenes/Elinor.Scene.Spellbook.pas index 461cdd5..5171be9 100644 --- a/sources/Scenes/Elinor.Scene.Spellbook.pas +++ b/sources/Scenes/Elinor.Scene.Spellbook.pas @@ -71,8 +71,8 @@ procedure TSceneSpellbook.CastSpell; end; Spells.ActiveSpell.SetActiveSpell(LSpellEnum); Game.Mana.Modify(-LMana); - Game.MediaPlayer.PlaySound(mmSpellbook); - Game.MediaPlayer.PlaySound(mmPrepareMagic); + Game.MediaPlayer.PlaySound('spellbook'); + Game.MediaPlayer.PlaySound('prepare_magic'); Game.Show(scMap); end; end; @@ -80,8 +80,8 @@ procedure TSceneSpellbook.CastSpell; class procedure TSceneSpellbook.HideScene; begin Game.Show(CloseSceneEnum); - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSpellbook); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('spellbook'); end; constructor TSceneSpellbook.Create; @@ -210,7 +210,7 @@ procedure TSceneSpellbook.Render; class procedure TSceneSpellbook.ShowScene(const ACloseSceneEnum: TSceneEnum); begin CloseSceneEnum := ACloseSceneEnum; - Game.MediaPlayer.PlaySound(mmSpellbook); + Game.MediaPlayer.PlaySound('spellbook'); Game.Show(scSpellbook); end; diff --git a/sources/Scenes/Elinor.Scene.Temple.pas b/sources/Scenes/Elinor.Scene.Temple.pas index 90e131b..723ea32 100644 --- a/sources/Scenes/Elinor.Scene.Temple.pas +++ b/sources/Scenes/Elinor.Scene.Temple.pas @@ -72,13 +72,13 @@ class procedure TSceneTemple.ShowScene(AParty: TParty); else ActivePartyPosition := AParty.GetRandomPosition; Game.Show(scTemple); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('settlement'); end; class procedure TSceneTemple.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlaySound(mmSettlement); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlaySound('settlement'); Game.Show(scSettlement); end; @@ -144,7 +144,7 @@ procedure TSceneTemple.Heal; end; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); HealIt(CurrentParty, ActivePartyPosition); end; @@ -152,7 +152,7 @@ procedure TSceneTemple.HealCreature; begin Game.Gold.Modify(-ConfirmGold); ConfirmParty.Heal(ConfirmPartyPosition); - Game.MediaPlayer.PlaySound(mmHeal); + Game.MediaPlayer.PlaySound('heal'); end; procedure TSceneTemple.MouseDown(AButton: TMouseButton; Shift: TShiftState; @@ -189,7 +189,7 @@ procedure TSceneTemple.MouseMove(Shift: TShiftState; X, Y: Integer); procedure TSceneTemple.ShowPartyScene; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); TSceneParty2.ShowScene(CurrentParty, scTemple); end; @@ -265,7 +265,7 @@ procedure TSceneTemple.Revive; end; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); ReviveIt(CurrentParty, ActivePartyPosition); end; @@ -273,7 +273,7 @@ procedure TSceneTemple.ReviveCreature; begin Game.Gold.Modify(-ConfirmGold); ConfirmParty.Revive(ConfirmPartyPosition); - Game.MediaPlayer.PlaySound(mmRevive); + Game.MediaPlayer.PlaySound('revive'); end; procedure TSceneTemple.Timer; diff --git a/sources/Scenes/Elinor.Scene.Victory.pas b/sources/Scenes/Elinor.Scene.Victory.pas index 8b304ff..e3129d3 100644 --- a/sources/Scenes/Elinor.Scene.Victory.pas +++ b/sources/Scenes/Elinor.Scene.Victory.pas @@ -52,13 +52,13 @@ class procedure TSceneVictory.ShowScene; begin ActivePartyPosition := TLeaderParty.GetPosition; Game.Show(scVictory); - Game.MediaPlayer.PlayMusic(CMusicVictory); + Game.MediaPlayer.PlayMusic('victory'); end; class procedure TSceneVictory.HideScene; begin - Game.MediaPlayer.PlaySound(mmClick); - Game.MediaPlayer.PlayMusic(CMusicMenu); + Game.MediaPlayer.PlaySound('click'); + Game.MediaPlayer.PlayMusic('menu'); Game.IsGame := False; Game.LeaderRecordsTable.AddRecord (TCreature.Character(TLeaderParty.Leader.Enum).Name[0], diff --git a/sources/Scenes/Elinor.Scenes.pas b/sources/Scenes/Elinor.Scenes.pas index dda9e9d..8bfc3cd 100644 --- a/sources/Scenes/Elinor.Scenes.pas +++ b/sources/Scenes/Elinor.Scenes.pas @@ -340,7 +340,7 @@ constructor TGame.Create; Statistics := TStatistics.Create; Scenario := TScenario.Create; MediaPlayer := TMediaPlayer.Create; - MediaPlayer.PlayMusic(CMusicMenu); + MediaPlayer.PlayMusic('menu'); SceneEnum := scIntro; end; @@ -405,7 +405,7 @@ procedure TGame.NewDay; ShowNewDayMessageTime := 20; if (RandomRange(0, 100) <= 5) then Merchants.Clear; - MediaPlayer.PlaySound(mmDay); + MediaPlayer.PlaySound('new_day'); IsNewDay := False; if (Game.Day > TScenario.GetDayLimit(Difficulty.Level, Game.Scenario.CurrentScenario, True)) then @@ -534,7 +534,7 @@ procedure TScene.AddTextLine(const AMessage: string; const V, M: Integer); procedure TScene.ConfirmDialog(const AMessage: string; OnYes: TConfirmMethod); begin - Game.MediaPlayer.PlaySound(mmExit); + Game.MediaPlayer.PlaySound('exit'); Game.InformMsg := AMessage; Game.IsShowConfirm := True; ConfirmHandler := OnYes; @@ -542,7 +542,7 @@ procedure TScene.ConfirmDialog(const AMessage: string; OnYes: TConfirmMethod); procedure TScene.InformDialog(const AMessage: string); begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.InformMsg := AMessage; Game.IsShowInform := idtMessage; end; @@ -553,7 +553,7 @@ procedure TScene.ItemInformDialog(const AItemEnum: TItemEnum); const CLeft = ' '; begin - Game.MediaPlayer.PlaySound(mmClick); + Game.MediaPlayer.PlaySound('click'); Game.InformSL.Clear; Game.InformImage := reNone; Game.InformItemImage := TItemBase.Item(AItemEnum).ItRes;