Skip to content

Commit

Permalink
add battle musics
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Gatto <uso.cosmo.ray@gmail.com>
  • Loading branch information
cosmo-ray committed Dec 16, 2023
1 parent 14827d5 commit fef414a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
15 changes: 14 additions & 1 deletion actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ function CombatEnd(wid, _main, winner_id)
local looser = Entity.wrapp(yJrpgGetLooser(wid, winner_id))

ySoundStop(main.soundcallgirl)
ySoundStop(main.soundfrenetic)
ySoundStop(main.soundgoodf)
wid.main = nil
if yLovePtrToNumber(winner_id) == 3 then
-- you lose
Expand Down Expand Up @@ -329,7 +331,18 @@ function StartFight(wid, eve, enemy_type, script)
local main = getMainWid(wid)
local fWid = Entity.new_array()
local npc
--ySoundPlayLoop(main.soundcallgirl:to_int())

local music_rand = yuiRand() % 3

print(music_rand, main_widget.soundcallgirl:to_int(),
main_widget.soundfrenetic, main_widget.soundgoodf)
if music_rand == 0 then
ySoundPlayLoop(main_widget.soundcallgirl:to_int())
elseif music_rand == 1 then
ySoundPlayLoop(yeGetInt(main_widget.soundfrenetic));
else
ySoundPlayLoop(yeGetInt(main_widget.soundgoodf));
end

fight_script = nil
if yIsNNil(script) then
Expand Down
4 changes: 2 additions & 2 deletions menus.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ Good luck and good drinks!
"text" : "todo
sprites from www.opengameart.org
music from www.rengoku-teihen.com
Ther's an imgs/credit.txt that try to resence all art author
There's an imgs/credit.txt that try to resence all art author
music are in music/credit.txt
If I've forgot an artwork, thank to create an issue, Pull Request
or notice me :)
to copy past website, use a terminal and do:
Expand Down Expand Up @@ -238,7 +239,6 @@ We love you anyway",
"######### THE END #########",
"#########################################################"],
"next" : "phq:menus.Credit"

},
"game" : {
"<type>" : "phq",
Expand Down
7 changes: 7 additions & 0 deletions music/credit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
frenetic-fight.mp3:
https://opengameart.org/content/the-battle-ahead-v2
by https://opengameart.org/users/wanderer576

good-fight.ogg:
https://opengameart.org/content/the-good-fight
by Christovix Games
Binary file added music/frenetic-fight.mp3
Binary file not shown.
Binary file added music/good-fight.ogg
Binary file not shown.
3 changes: 3 additions & 0 deletions phq.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,9 @@ function create_phq(entity, _eve, _menu)
local ret = container:new_wid()
ent.destroy = Entity.new_func(destroy_phq)

ent.soundfrenetic = ySoundMusicLoad("./music/frenetic-fight.mp3")
ent.soundgoodf = ySoundMusicLoad("./music/good-fight.ogg")
ent.soundcallgirl = ySoundMusicLoad("./callgirl.mp3")
ent.soundcallgirl = ySoundMusicLoad("./callgirl.mp3")
ent.soundhouse = ySoundMusicLoad("./house_music.mp3")
ent.soundtatata = ySoundMusicLoad("./rekuiemu.mp3")
Expand Down

0 comments on commit fef414a

Please sign in to comment.