Skip to content

Commit

Permalink
address #242, fix force rebuild, started development of event cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurkars committed Sep 18, 2023
1 parent 68ad89a commit 65089e0
Show file tree
Hide file tree
Showing 34 changed files with 1,495 additions and 3,117 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Multiple clients are supported by a server component [Gloomhaven Secretariat Ser

Since *GHS* is a web application, no installation is required and it runs in any modern browser, even on mobile devices, but it can also be [installed](#install) for offline use.

*Gloomhaven Secretariat is open-source software built with [Angular](https://angular.io/) and is open for the community to actively [contribute](#contributing) ideas, suggestions and of course feedback and bug fixes.
*Gloomhaven Secretariat* is open-source software built with [Angular](https://angular.io/) and is open for the community to actively [contribute](#contributing) ideas, suggestions and of course feedback and bug fixes.

A basic user guide is available [online](https://help.gloomhaven-secretariat.de).

Expand All @@ -43,9 +43,9 @@ A basic user guide is available [online](https://help.gloomhaven-secretariat.de)
- **Character Attack Modifier Deck** including Perks & CS Oak Cards
- **Elements** automatic update status
- **Monster Stats**
- **Monster Standees** automatically adds stats for scenario rooms/sections and special rules (room/section data WIP)
- **Monster Standees** automatically adds standees for scenario rooms/sections and special rules
- **Monster Modifier Deck** Adding **Blessings** and **Curses**, auto-shuffling
- **Monster Ability Cards** auto-shuffling, calculated values (separate for normal and elite)
- **Monster Ability Cards** auto-shuffling, calculated values (separate for normal and elite), add stats values
- **Character Summons**
- **Scenarios** and **Sections** with automatic level calculation, displays and applies special rules, and applies scenario results to character progression
- **Party Sheet**
Expand Down Expand Up @@ -90,10 +90,9 @@ A basic user guide is available [online](https://help.gloomhaven-secretariat.de)
> To add Envelope X (or V for ToA), enable it under *Data Management*, then enter the full name in the *Character Filter* (not case sensitive).
</details>
### Short term plans
### Planned next

- Validate all existing data
- Address all issues
- Support for event cards (draw, manage, apply rewards)

### Long term plans

Expand Down
2 changes: 1 addition & 1 deletion data/fh/label-spoiler/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
".": "Well Strung Bow"
},
"fh-21": {
"1": "While you are adjacent to tree or more enemies, gain %game.action.shield:1%.",
"1": "While you are adjacent to three or more enemies, gain %game.action.shield:1%.",
".": "Chain Hood"
},
"fh-22": {
Expand Down
4 changes: 2 additions & 2 deletions data/fh/label/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
},
"1337": {
".": "Sleeper",
"text": "Have on or more cards in your hand each time you rest."
"text": "Have one or more cards in your hand each time you rest."
},
"1338": {
".": "Sluggard",
Expand Down Expand Up @@ -338,7 +338,7 @@
},
"1348": {
".": "Dawdler",
"text": "Never us your lowest initiative played card as your initiative card."
"text": "Never use your lowest initiative played card as your initiative card."
},
"1349": {
".": "Duelist",
Expand Down
3,399 changes: 347 additions & 3,052 deletions data/gh/events.json

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions data/gh/label-spoiler/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,97 @@
".": "Resonant Crystal"
}
},
"events": {
"gh": {
"city": {
"0": {
"text": "",
"options": {
"1": {
"choice": "",
"outcome": "",
"effects": {
"1": {
"1": ""
}
}
},
"2": {
"choice": "",
"outcome": "",
"effects": {
"1": {
"1": ""
}
}
}
}
},
"1": {
"text": "You decide to unwind at the Sleeping Lion, but just as you are starting to relax, a bear of a man crashes into your table, scattering your drinks across the floor.<br><br>Towering over him is a massive Inox. \"What did you say about my horns?\" the Inox shouts.<br><br>The man stands up and brushes shards of glass from his tunic. \"I said the sight of them makes me want to vomit!\"<br><br>The Inox roars and charges headlong into the man, crashing through more tables in the process. At this, the entire tavern erupts into violence. After all, when a man is deep into his drink, the last thing you want to do is knock that drink over.",
"options": {
"1": {
"choice": "Join the fray! These insults will not go unanswered!",
"outcome": "Nothing like busting some drunken skulls to lift one's spirits. It turns out to be a great way to unwind. Unfortunately, the proprietor of the Sleeping Lion doesn't exactly see it that way, and he sullenly asks for compensation for the damage you caused."
},
"2": {
"choice": "Do your best to stop the fighting. This is a respectable establishment.",
"outcome": "After restraining the enraged Inox and offering to replace the drinks of a few of the more belligerent patrons, you calm the place down a bit. Some of the non-human patrons are understandably on edge, but the proprietor thanks you for your efforts and reimburses you for the drinks."
}
}
},
"2": {
"text": "As the daylight fades, you find yourselves wandering through a half-crowded market street, browsing wares.<br><br>\"Hey! Over here!\" You turn in the direction of the voice to see a filthy Vermling gesturing from a dark alley. \"Yeah, you grim-looking chaps. I have something you might be interested in.\"<br><br>The Vermling holds out a piece of metal covered in sludge. \"Found this in the sewer. Writing on it I don't understand, but I know it's valuable. You can have it for ten gold!\"",
"options": {
"1": {
"choice": "Pay for the thing. You never know.",
"effects": {
"1": {
"1": "You hand over the gold and take hold of the piece of garbage. Amidst troubling brown smears you see a lot of meaningless scratches likely made by rats and bugs. Oh well. Sometimes the long shot doesn't pay off.",
"2": "\"Bah! You don't have enough. Come back when you do!\""
}
}
},
"2": {
"choice": "Refuse to pay. Never trust a Vermling.",
"outcome": "You laugh and gesture the Vermling away. You can recognize a low-life swindler when you see one. And that piece of garbage was just...foul."
}
}
},
"3": {
"text": "As the daylight fades, you find yourselves wandering through a half-crowded market street, browsing wares.<br><br>\"Hey! Over here!\" You turn in the direction a of the voice to see a filthy Vermling gesturing from a dark alley \"Yeah, you grim-looking chaps. I have something you might be interested in.\"<br><br>The Vermling holds out a piece of metal covered in sludge. Found this in the sewer. Writing on it I don't understand, but I know its valuable. You can have it for ten gold!\"",
"options": {
"1": {
"choice": "Pay for the thing. You never know.",
"effects": {
"1": {
"1": "You hand over the gold and take hold of the metal. You wipe off the grime and slop to discover a foreign contraption made of large gears and many moving parts. If you can figure out what it is, this device might actually be of some worth.",
"2": "\"Bah! You don't have enough. Come back when you do!\""
}
}
},
"2": {
"choice": "Refuse to pay. Never trust a Vermling.",
"outcome": "You laugh and gesture the Vermling away. You can recognize a low-life swindler when you see one. And that piece of garbage was just..foul."
}
}
},
"4": {
"text": "Having recently returned from your latest adventure, you are approached by a ratty-looking boy in tears.<br><br>\"Please, sirs, could you please help me with my cat? He went over there, and I'm afraid.\" The boy points a dirty finger at a decrepit, abandoned building. \"I don't know what else to do.\"",
"options": {
"1": {
"choice": "Find a cat? You have more important things to do.",
"outcome": "You shake your head and direct the boy to go find his mother. With any luck she will knock some sense into him so that he stops troubling strangers with such trivial matters."
},
"2": {
"choice": "Reassure the boy and go find the cat.",
"outcome": "You approach the foreboding house full of heroic bravado. There's certainly nothing otherworldly about the structure, but its fallen beams and piles of rubble do make it difficult to look around. By the time you find the cat hiding under a burned-out bed frame, you are utterly exhausted. At least the boy is ecstatic his cat has been found."
}
}
}
}
}
},
"treasures": {
"gh": {
"75": "Cryptogram Found (See scenario book page 121)"
Expand Down
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gloomhavensecretariat",
"version": "0.77.0",
"version": "0.77.1",
"license": "AGPL3",
"description": "Gloomhaven Secretariat is a Gloomhaven Companion app.",
"homepage": "https://gloomhaven-secretariat.de",
Expand Down Expand Up @@ -97,7 +97,7 @@
"@angular/cli": "^16.2.2",
"@angular/compiler-cli": "^16.2.5",
"@types/dom-screen-wake-lock": "1.0.1",
"@types/jasmine": "~4.3.5",
"@types/jasmine": "~4.3.6",
"@types/leaflet": "^1.9.4",
"@types/uuid": "^9.0.4",
"electron": "^26.2.1",
Expand Down
1 change: 1 addition & 0 deletions scripts/build-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ for (edition_path of edition_dirs) {
edition_data['decks'] = load_subfolder(edition_path, 'deck', []);
edition_data['scenarios'] = load_file(edition_path, 'scenarios.json', []);
edition_data['battleGoals'] = load_file(edition_path, 'battle-goals.json', []);
edition_data['events'] = load_file(edition_path, 'events.json', []);
edition_data['campaign'] = load_file(edition_path, 'campaign.json', undefined);

if (edition_data['campaign']) {
Expand Down
2 changes: 2 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { MonsterEditorComponent } from './ui/tools/editor/monster/monster';
import { AttackModifierStandaloneComponent } from './ui/tools/standalone/attackmodifier-standalone';
import { LootDeckStandaloneComponent } from './ui/tools/standalone/loot-deck-standalone';
import { TreasuresToolComponent } from './ui/tools/treasures/treasures-tool';
import { EventCardsToolComponent } from './ui/tools/events/event-cards-tool';


const routes: Routes = [
Expand All @@ -19,6 +20,7 @@ const routes: Routes = [
{ path: 'editor/character', component: CharacterEditorComponent },
{ path: 'tools/attackmodifier', component: AttackModifierToolComponent },
{ path: 'tools/decks', component: DecksToolComponent },
{ path: 'tools/events', component: EventCardsToolComponent },
{ path: 'tools/treasures', component: TreasuresToolComponent },
{ path: 'loot', component: LootDeckStandaloneComponent },
{ path: 'am', component: AttackModifierStandaloneComponent },
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { AutoscrollDirective, FigureAutoscrollDirective } from './ui/helper/auto
import { AttackModifierDeckComponent } from './ui/figures/attackmodifier/attackmodifierdeck';
import { AttackModifierComponent } from './ui/figures/attackmodifier/attackmodifier';
import { AttackModifierToolComponent } from './ui/tools/attackmodifier/attackmodifier-tool';
import { EventCardsToolComponent } from './ui/tools/events/event-cards-tool';
import { TreasuresToolComponent } from './ui/tools/treasures/treasures-tool';
import { TextShrinkDirective } from './ui/helper/textshrink';
import { EntityMenuDialogComponent } from './ui/figures/entity-menu/entity-menu-dialog';
Expand Down Expand Up @@ -129,6 +130,8 @@ import { ItemDialogComponent } from './ui/figures/items/dialog/item-dialog';
import { TreasuresDialogComponent } from './ui/header/party/treasures/treasures-dialog';
import { ValueSignDirective } from './ui/helper/ValueSign';
import { AdditionalAMSelectDialogComponent } from './ui/figures/entity-menu/additional-am-select/additional-am-select';
import { EventCardComponent } from './ui/figures/event/event-card'
import { EventRewardLabelComponent } from './ui/figures/event/label/label';
import { environment } from 'src/environments/environment';

@Injectable()
Expand Down Expand Up @@ -156,6 +159,7 @@ export class GhsErrorHandler extends ErrorHandler {
ConditionsComponent, HighlightConditionsComponent, ConditionHighlightAnimationDirective, HealthbarComponent,
EntityMenuDialogComponent, EntitiesMenuDialogComponent, AdditionalAMSelectDialogComponent,
CharacterComponent, CharacterImageComponent, CharacterSummonDialog, CharacterInitiativeComponent, CharacterInitiativeDialogComponent, CharacterSheetComponent, CharacterSheetDialog, CharacterFullViewComponent, CharacterLootCardsDialog, PerkLabelComponent, CharacterMoveResourcesDialog, ItemComponent, ItemDialogComponent, ItemsDialogComponent, ItemsCharacterDialogComponent, CharacterItemsComponent, ItemsBrewDialog, BattleGoalComponent, CharacterBattleGoalsDialog, BattleGoalSetupDialog,
EventCardComponent, EventRewardLabelComponent,
ObjectiveComponent, ObjectiveContainerComponent,
SummonEntityComponent, SummonSheetComponent,
StandeeComponent,
Expand All @@ -169,7 +173,7 @@ export class GhsErrorHandler extends ErrorHandler {
FigureErrorsComponent, FigureErrorsDialogComponent,
CardRevealDirective, EntityAnimationDirective, GhsLabelDirective, ValueCalcDirective, PointerInputDirective, AutocompleteDirective, AutoscrollDirective, FigureAutoscrollDirective, TextShrinkDirective, ValueSignDirective,
GhsValueSignPipe, GhsRangePipe, GhsScenarioSearch, GhsFloorPipe, GhsCeilPipe, GhsMinZeroPipe,
AttackModifierToolComponent, TreasuresToolComponent, DecksToolComponent,
AttackModifierToolComponent, EventCardsToolComponent, TreasuresToolComponent, DecksToolComponent,
EditionEditorComponent,
EditorActionComponent, EditorActionDialogComponent,
DeckEditorComponent, CharacterEditorComponent, MonsterEditorComponent,
Expand Down
16 changes: 16 additions & 0 deletions src/app/game/businesslogic/EventCardManager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Game } from "../model/Game";
import { EventCard } from "../model/data/EventCard";
import { gameManager } from "./GameManager";

export class EventCardManager {
game: Game;

constructor(game: Game) {
this.game = game;
}

getEventCardsForEdition(type: string, edition: string): EventCard[] {
return gameManager.editionData.filter((editionData) => editionData.edition == edition || gameManager.editionExtensions(edition).indexOf(edition) != -1).flatMap((editionData) => editionData.events).filter((eventCard) => eventCard.type == type);
}

}
Loading

0 comments on commit 65089e0

Please sign in to comment.