From ce5e4ca7be3bca6b50ed03b554a8b789fa264129 Mon Sep 17 00:00:00 2001 From: Nicky Case Date: Thu, 18 Jul 2019 10:45:01 -0400 Subject: [PATCH] and special attacks --- scenes/act2_test.md | 12 +++++++++--- scripts/game/Game.js | 9 +++++++++ styles/game.css | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/scenes/act2_test.md b/scenes/act2_test.md index 60afdb8..649c11d 100644 --- a/scenes/act2_test.md +++ b/scenes/act2_test.md @@ -92,11 +92,17 @@ music('battle', {volume:0.5}); bb({body:"special_a"}); ``` -[🗡](#act2h_attack) `_.SPECIAL_ATTACK="harm"; Game.OVERRIDE_CHOICE_LINE=true` +`Game.OVERRIDE_CHOICE_SPEAKER = "fear_harm"` -[💔](#act2h_attack) `_.SPECIAL_ATTACK="alone"; Game.OVERRIDE_CHOICE_LINE=true` +[](#act2h_attack) `_.SPECIAL_ATTACK="harm"; Game.OVERRIDE_CHOICE_LINE=true` -[👿](#act2h_attack) `_.SPECIAL_ATTACK="bad"; Game.OVERRIDE_CHOICE_LINE=true` +`Game.OVERRIDE_CHOICE_SPEAKER = "fear_alone"` + +[](#act2h_attack) `_.SPECIAL_ATTACK="alone"; Game.OVERRIDE_CHOICE_LINE=true` + +`Game.OVERRIDE_CHOICE_SPEAKER = "fear_bad"` + +[](#act2h_attack) `_.SPECIAL_ATTACK="bad"; Game.OVERRIDE_CHOICE_LINE=true` # act2h_attack diff --git a/scripts/game/Game.js b/scripts/game/Game.js index 991358f..f805b78 100644 --- a/scripts/game/Game.js +++ b/scripts/game/Game.js @@ -323,6 +323,15 @@ Game.executeText = function(line){ var speaker = line.match(regex)[1].trim(); var dialogue = line.match(regex)[2].trim(); + // IF IT'S A SPECIAL ATTACK, SKIP ALL THIS SHIT + if(speaker=="fear_harm" || speaker=="fear_alone" || speaker=="fear_bad"){ + Game.setTimeout(function(){ + publish("hide_click_to_advance"); + resolve(); // DONE WITH IT. + }, Game.TEXT_SPEED*7); + return; + } + // Add the bubble, with animation var div = document.createElement("div"); Game.wordsDOM.appendChild(div); diff --git a/styles/game.css b/styles/game.css index 247220a..9ace2f5 100644 --- a/styles/game.css +++ b/styles/game.css @@ -953,6 +953,28 @@ DIALOGUEZ #game_choices > div[speaker=h2]:hover{ color: #888; } +#game_choices > div[speaker=fear_harm], #game_choices > div[speaker=fear_alone], #game_choices > div[speaker=fear_bad]{ + background-size: 100%; + width:100px; height:100px; + padding: 0; + position: absolute; + margin-top: 25px; +} +#game_choices > div[speaker=fear_harm]{ + background-image: url(../sprites/ui/fear_harm.png); + left:20px; +} +#game_choices > div[speaker=fear_alone]{ + background-image: url(../sprites/ui/fear_alone.png); + left:130px; +} +#game_choices > div[speaker=fear_bad]{ + background-image: url(../sprites/ui/fear_bad.png); + left:240px; +} +#game_choices > div[speaker=fear_harm]:hover, #game_choices > div[speaker=fear_alone]:hover, #game_choices > div[speaker=fear_bad]:hover{ + margin-top: 22px; +} /***********************************/ /***********************************/