Skip to content

Commit

Permalink
Update for 2.14.0-beta.dev.20241202.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacetech committed Dec 2, 2024
1 parent f55dfc8 commit 1ed6671
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"watch": "npx tsc --build --watch --pretty --preserveWatchOutput"
},
"devDependencies": {
"@wayward/types": "^2.14.0-beta.dev.20241130.1",
"@wayward/types": "^2.14.0-beta.dev.20241201.1",
"rimraf": "3.0.2",
"typescript": "^5.7.2"
}
Expand Down
20 changes: 11 additions & 9 deletions src/Magicology.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { SfxType } from "@wayward/game/audio/IAudio";
import { EventHandler } from "@wayward/game/event/EventManager";
import { DoodadTypeGroup } from "@wayward/game/game/doodad/IDoodad";
import Human from "@wayward/game/game/entity/Human";
import type Human from "@wayward/game/game/entity/Human";
import { DamageType, Defense, MoveType } from "@wayward/game/game/entity/IEntity";
import { EquipType, SkillType } from "@wayward/game/game/entity/IHuman";
import { Stat, StatDisplayType } from "@wayward/game/game/entity/IStats";
import type { Stat } from "@wayward/game/game/entity/IStats";
import { StatDisplayType } from "@wayward/game/game/entity/IStats";
import { StatChangeCurrentTimerStrategy } from "@wayward/game/game/entity/StatFactory";
import { ActionType } from "@wayward/game/game/entity/action/IAction";
import Creature from "@wayward/game/game/entity/creature/Creature";
import { CreatureType, TileGroup } from "@wayward/game/game/entity/creature/ICreature";
import type Creature from "@wayward/game/game/entity/creature/Creature";
import type { CreatureType } from "@wayward/game/game/entity/creature/ICreature";
import { TileGroup } from "@wayward/game/game/entity/creature/ICreature";
import { Source } from "@wayward/game/game/entity/player/IMessageManager";
import Player from "@wayward/game/game/entity/player/Player";
import { EquipEffect, ItemType, ItemTypeGroup, RecipeLevel } from "@wayward/game/game/item/IItem";
import { RecipeComponent } from "@wayward/game/game/item/ItemDescriptions";
import { TileEventType } from "@wayward/game/game/tile/ITileEvent";
import Dictionary from "@wayward/game/language/Dictionary";
import type Dictionary from "@wayward/game/language/Dictionary";
import Translation from "@wayward/game/language/Translation";
import Message from "@wayward/game/language/dictionary/Message";
import type Message from "@wayward/game/language/dictionary/Message";
import Mod from "@wayward/game/mod/Mod";
import Register, { Registry } from "@wayward/game/mod/ModRegistry";
import { ParticleType } from "@wayward/game/renderer/particle/IParticle";
Expand All @@ -26,7 +28,7 @@ import Color from "@wayward/utilities/Color";

import Deity from "@wayward/game/game/deity/Deity";
import { AiType } from "@wayward/game/game/entity/ai/AI";
import TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
import type TranslationImpl from "@wayward/game/language/impl/TranslationImpl";
import { MagicologyTranslation } from "./IMagicology";
import { createAttackAction, createConjureAction, createDematerializeAction, createMaterializeAction } from "./MagicologyActions";

Expand Down Expand Up @@ -120,7 +122,7 @@ export default class Magicology extends Mod {
ranged: {
range: 8,
attack: 5,
ammunitionType: (action) => {
ammunitionType: action => {
switch (action.actionStack[0]) {
case Magicology.INSTANCE.actionFireball:
return Magicology.INSTANCE.itemFireball;
Expand All @@ -131,7 +133,7 @@ export default class Magicology extends Mod {

return undefined;
},
particles: (action) => {
particles: action => {
switch (action.actionStack[0]) {
case Magicology.INSTANCE.actionFireball:
return particles[ParticleType.Fire];
Expand Down
19 changes: 12 additions & 7 deletions src/MagicologyActions.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { AttackType, EntityType } from "@wayward/game/game/entity/IEntity";
import { Action } from "@wayward/game/game/entity/action/Action";
import { ActionArgument, ActionDisplayLevel, IActionUsable } from "@wayward/game/game/entity/action/IAction";
import type { IActionUsable } from "@wayward/game/game/entity/action/IAction";
import { ActionArgument, ActionDisplayLevel } from "@wayward/game/game/entity/action/IAction";
import Attack from "@wayward/game/game/entity/action/actions/Attack";

import { SfxType } from "@wayward/game/audio/IAudio";
import { Delay } from "@wayward/game/game/entity/IHuman";
import { Stat } from "@wayward/game/game/entity/IStats";
import { NotUsableMessage, NotUsableMessageItem } from "@wayward/game/game/entity/action/actions/helper/NotUsableMessage";
import Creature from "@wayward/game/game/entity/creature/Creature";
import type Creature from "@wayward/game/game/entity/creature/Creature";
import { TileGroup } from "@wayward/game/game/entity/creature/ICreature";
import { MessageType, Source } from "@wayward/game/game/entity/player/IMessageManager";
import { ItemTypeGroup } from "@wayward/game/game/item/IItem";
import Item from "@wayward/game/game/item/Item";
import Tile from "@wayward/game/game/tile/Tile";
import type Item from "@wayward/game/game/item/Item";
import type Tile from "@wayward/game/game/tile/Tile";
import Translation from "@wayward/game/language/Translation";
import Message from "@wayward/game/language/dictionary/Message";
import Magicology from "./Magicology";

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const createAttackAction = (requiredMana: number) => new Action(ActionArgument.ItemInventory)
.setUsableBy(EntityType.Human)
.setCanUse((action, item) => {
Expand All @@ -36,9 +38,10 @@ export const createAttackAction = (requiredMana: number) => new Action(ActionArg
.setHandler((action, item) => {
action.executor.stat.reduce(Magicology.INSTANCE.statMana, requiredMana);

Attack.execute(action, item, AttackType.RangedWeapon);
void Attack.execute(action, item, AttackType.RangedWeapon);
});

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const createConjureAction = (requiredMana: number) => new Action(ActionArgument.ItemInventory)
.setUsableBy(EntityType.Human)
.setPreExecutionHandler((action, item) => action.addItems(item))
Expand Down Expand Up @@ -112,6 +115,7 @@ interface IMaterializeCanUse extends IActionUsable {

const CannotUseSomethingInTheWay = NotUsableMessageItem({ message: Message.SomethingInTheWayOfSummoning });

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const createMaterializeAction = (requiredMana: number) => new Action(ActionArgument.ItemInventory)
.setUsableBy(EntityType.Human)
.setPreExecutionHandler((action, item) => action.addItems(item))
Expand Down Expand Up @@ -180,7 +184,7 @@ export const createMaterializeAction = (requiredMana: number) => new Action(Acti
creature.tile.createParticles(creature.tile.description?.particles);

// serve the player forever
renderers.notifier.suspend((creature) => {
renderers.notifier.suspend(creature => {
creature.tame(action.executor, Number.MAX_SAFE_INTEGER);
}, creature);

Expand All @@ -205,6 +209,7 @@ interface IDematerializeCanUse extends IActionUsable {
creatures: Creature[];
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const createDematerializeAction = () => new Action(ActionArgument.ItemInventory)
.setUsableBy(EntityType.Human)
.setCanUse<IDematerializeCanUse>((action, item) => {
Expand Down Expand Up @@ -240,4 +245,4 @@ export const createDematerializeAction = () => new Action(ActionArgument.ItemInv
.send(Magicology.INSTANCE.messageYouHaveDematerialized, Translation.formatList(creatures.map(creature => creature.getName())));

action.setPassTurn();
});
});

0 comments on commit 1ed6671

Please sign in to comment.