Skip to content

Commit

Permalink
Sketch the Karl side quest
Browse files Browse the repository at this point in the history
  • Loading branch information
filiph committed Jan 17, 2020
1 parent ffe4f8f commit 0f06f2f
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// ---
APPROACH: $elevator_28 FROM $elevator_12
COMMAND: Go >> climb up
DESCRIPTION: [We] climb up using an ancient rusty ladder.

// ---
APPROACH: $elevator_28 FROM $maintenance_shaft
COMMAND: Go >> to the elevator
DESCRIPTION: $NONE

// ---
APPROACH: $elevator_28 FROM $gods_lair
COMMAND: Go >> to the elevator
DESCRIPTION: $NONE

// ---
ROOM: $elevator_28

POS: 32, 72

DESCRIPTION:
Orc noises from all around, but thankfully no orc in sight. [[IF !$(c).hasHappened(evKarlGuardsKilled)]]Brutal laughter from the east.[[ENDIF]]
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
// ---
APPROACH: $gods_lair FROM $elevator_28
COMMAND: Go >> east
DESCRIPTION: $NONE

// ---
ROOM: $gods_lair

FLAGS: $IDLE

POS: 35, 42

DESCRIPTION:
This is God's lair.
FIRST_DESCRIPTION:
Two orcs, a berserker and a captain, watch you approach in amazement.

"You!" the captain bellows. "Stand still so I can chop off your head."

DESCRIPTION:
The gate to God's lair.

FIGHT_SITUATION:
generateGodsLairFight

AFTER_MONSTERS_CLEARED:
A grumbling from behind the gate.

[[CODE]]
$(c).markHappened(evKarlGuardsKilled);
[[ENDCODE]]


// ---
ROOM: $gods_lair_after_necromancy

VARIANT_OF: $gods_lair

RULE: $(c).hasHappened(evKarlKilledViaNecromancy)

DESCRIPTION:
The gate is open. Inside, a giant's carcass lies. It's belly is teared open from the inside, by a large beaked bird.

Two dead orcs lie next to a wall.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// ---
APPROACH: $maintenance_shaft FROM $elevator_28
COMMAND: Go >> climb into the shaft
DESCRIPTION: $NONE

// ---
ROOM: $maintenance_shaft

POS: 34, 40

FIRST_DESCRIPTION:
Musty, dark place. Through cracks, I can see rooms under me.

[[IF !$(c).hasHappened(evKarlGuardsKilled)]]Going to the end of the shaft, I can see two orcs below, guarding some kind of a large gate. A berserker and a captain.[[ENDIF]]

DESCRIPTION:
Musty, dark place.


// --
ACTION: $karl_use_necromancy
COMMAND: Use >> Necromancy
FOR_LOCATION: $maintenance_shaft
PREREQUISITES:
w.actionNeverUsed(name)
&&
!$(c).hasHappened(evKarlKilled)

COMPLETE_SUCCESS_PROBABILITY: 100%
COMPLETE_SUCCESS_DESCRIPTION:
Terrible roar and thrashing comes from beyond the gate.

"What's going on?" the berserker asks and picks up his battle axe. "What's goind on with Karl?"

They go in, and are killed. Then, some more thrashing, then silence.

[[CODE]]
$(c).markHappened(evKarlKilled);
$(c).markHappened(evKarlGuardsKilled);
$(c).markHappened(evKarlKilledViaNecromancy);
[[ENDCODE]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ---
APPROACH: $elevator_12 FROM $knights_hq_main
COMMAND: Go >> to Floor 12 elevator
DESCRIPTION: $NONE
// TODO: PREREQUISITES - only after someone tells me

// ---
APPROACH: $elevator_12 FROM $elevator_28
COMMAND: Go >> climb down
DESCRIPTION: [We] climb down using an ancient rusty ladder.

// ---
ROOM: $elevator_12

FLAGS: $IDLE

POS: 32, 72

DESCRIPTION:
A rare access to the ancient elevator shaft.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ FIRST_DESCRIPTION:
(To be done: actual battle. Assume you won.)

[[CODE]]
w.recordCustom(evGoblinCampCleared);
$(c).markHappened(evGoblinCampCleared);
[[ENDCODE]]


DESCRIPTION:
The goblin camp is deserted.

[[CODE]]
w.recordCustom(evGoblinCampCleared);
[[ENDCODE]]
6 changes: 6 additions & 0 deletions edgehead/lib/edgehead_ids.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ const evGoblinCampCleared = "evGoblinCampCleared";

const evJisadSeesUndeadLeroy = "evJisadSeesUndeadLeroy";

const evKarlGuardsKilled = "evKarlGuardsKilled";

const evKarlHeardFirstTime = "evKarlHeardFirstTime";

const evKarlKilled = "evKarlKilled";

const evKarlKilledViaNecromancy = "evKarlKilledViaNecromancy";

const kbBlindGuide = "kbBlindGuide";

const kbGoblinCampSmoke = "kbGoblinCampSmoke";
Expand Down
40 changes: 40 additions & 0 deletions edgehead/lib/writers_helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,42 @@ FightSituation generateEscapeTunnelFight(ActionContext c,
});
}

/// God's lair fight.
FightSituation generateGodsLairFight(ActionContext c,
RoomRoamingSituation roomRoamingSituation, Iterable<Actor> party) {
final w = c.outputWorld;
final orcBerserker = Actor.initialized(w.randomInt(), "berserker",
nameIsProperNoun: false,
adjective: 'orc',
pronoun: Pronoun.HE,
currentWeapon: Item.weapon(w.randomInt(), WeaponType.axe,
name: 'battle axe', adjective: 'berserker'),
constitution: 3,
team: defaultEnemyTeam,
foldFunctionHandle: carelessMonsterFoldFunctionHandle);
final orcCaptain = Actor.initialized(w.randomInt(), 'captain',
nameIsProperNoun: false,
adjective: 'orc',
pronoun: Pronoun.HE,
currentWeapon:
Item.weapon(w.randomInt(), WeaponType.sword, adjective: 'labelled'),
constitution: 2,
team: defaultEnemyTeam,
foldFunctionHandle: carelessMonsterFoldFunctionHandle);

w.actors.addAll([orcBerserker, orcCaptain]);

return FightSituation.initialized(
w.randomInt(),
party,
[orcBerserker, orcCaptain],
"{|concrete} floor",
roomRoamingSituation,
{},
items: const [],
);
}

FightSituation generateMadGuardianFight(ActionContext c,
RoomRoamingSituation roomRoamingSituation, Iterable<Actor> party) {
final w = c.outputWorld;
Expand Down Expand Up @@ -817,6 +853,10 @@ class _HelperAccessor {
hearAbout(topic);
}

void markHappened(String eventId) {
_actionContext.outputWorld.recordCustom(eventId);
}

void movePlayer(String locationName, {bool silent = false}) {
getRoomRoaming().moveActor(_actionContext, locationName, silent: silent);
}
Expand Down
Loading

0 comments on commit 0f06f2f

Please sign in to comment.