From b8c3c96f8dbeeec513b5cb1fe522b54f75bdbba0 Mon Sep 17 00:00:00 2001 From: Sky Johnson Date: Thu, 19 Dec 2024 10:09:06 -0600 Subject: [PATCH] Finish updating the last links in fight to HTMX --- src/actions/fight.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/actions/fight.php b/src/actions/fight.php index 2087dea..c3c2d9f 100644 --- a/src/actions/fight.php +++ b/src/actions/fight.php @@ -164,7 +164,7 @@ function fight() if ($playerisdead != 1) { $page["command"] = <<
-
+

{$page['magiclist']}

@@ -173,7 +173,11 @@ function fight() user()->currentfight += 1; } else { - $page["command"] = "You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

You may now continue back to town, and we hope you fair better next time."; + $page["command"] = <<You have died.

+ As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

+ You may now continue back to town, and we hope you fair better next time. + HTML; } user()->save(); @@ -226,7 +230,7 @@ function victory() $spelltext = "You have learned a new spell.
"; } else { $spelltext = ""; $newspell=""; } - $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience. $warnexp
You gain $gold gold. $warngold

You have gained a level!

You gain ".$levelrow[user()->charclass."_hp"]." hit points.
You gain ".$levelrow[user()->charclass."_mp"]." magic points.
You gain ".$levelrow[user()->charclass."_tp"]." travel points.
You gain ".$levelrow[user()->charclass."_strength"]." strength.
You gain ".$levelrow[user()->charclass."_dexterity"]." dexterity.
$spelltext
You can now continue exploring."; + $page = "Congratulations. You have defeated the ".$monsterrow["name"].".
You gain $exp experience. $warnexp
You gain $gold gold. $warngold

You have gained a level!

You gain ".$levelrow[user()->charclass."_hp"]." hit points.
You gain ".$levelrow[user()->charclass."_mp"]." magic points.
You gain ".$levelrow[user()->charclass."_tp"]." travel points.
You gain ".$levelrow[user()->charclass."_strength"]." strength.
You gain ".$levelrow[user()->charclass."_dexterity"]." dexterity.
$spelltext
You can now continue exploring."; $title = "Courage and Wit have served thee well!"; $dropcode = ""; } else { @@ -235,10 +239,10 @@ function victory() if (rand(1, 30) === 1) { $droprow = db()->query('SELECT * FROM drops WHERE mlevel <= ? ORDER BY RANDOM() LIMIT 1;', [$monsterrow['level']])->fetchArray(SQLITE3_ASSOC); $dropcode = "dropcode='".$droprow["id"]."',"; - $page .= "This monster has dropped an item. Click here to reveal and equip the item, or you may also move on and continue exploring."; + $page .= "This monster has dropped an item. Click here to reveal and equip the item, or you may also move on and continue exploring."; } else { $dropcode = ""; - $page .= "You can now continue exploring."; + $page .= 'You can now continue exploring.'; } $title = "Victory!"; @@ -353,7 +357,7 @@ function drop() $page .= "
Select an inventory slot from the list below to equip this item. If the inventory slot is already full, the old item will be discarded."; $page .= "
"; - $page .= "You may also choose to just continue exploring and give up this item."; + $page .= "You may also choose to just continue exploring and give up this item."; return is_htmx() ? $page : display($page, "Item Drop"); } @@ -365,7 +369,7 @@ function dead() You have died.

As a consequence, you've lost half of your gold. However, you have been given back a portion of your hit points to continue your journey.

- You may now continue back to town, and we hope you fair better next time. + You may now continue back to town, and we hope you fair better next time. HTML; return is_htmx() ? $page : display($page, 'You Died'); }