Skip to content

Commit 13f1108

Browse files
committed
refactored actions and hooks to not contain underscores
1 parent 95dfc2d commit 13f1108

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/game-engine/world/action/magic-on-npc.action.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Npc } from '../actor/npc/npc';
88
/**
99
* Defines a button action hook.
1010
*/
11-
export interface Magic_On_NPCActionHook extends ActionHook<Magic_On_NPCAction, magic_on_npcActionHandler> {
11+
export interface MagicOnNPCActionHook extends ActionHook<MagicOnNPCAction, magiconnpcActionHandler> {
1212
// The npc world id that was clicked on after choosing the spell
1313
npcworldId?: number;
1414
// The IDs of the UI widgets that the buttons are on.
@@ -23,13 +23,13 @@ export interface Magic_On_NPCActionHook extends ActionHook<Magic_On_NPCAction, m
2323
/**
2424
* The button action hook handler function to be called when the hook's conditions are met.
2525
*/
26-
export type magic_on_npcActionHandler = (buttonAction: Magic_On_NPCAction) => void | Promise<void>;
26+
export type magiconnpcActionHandler = (buttonAction: MagicOnNPCAction) => void | Promise<void>;
2727

2828

2929
/**
3030
* Details about a button action being performed.
3131
*/
32-
export interface Magic_On_NPCAction {
32+
export interface MagicOnNPCAction {
3333
// The npc world id that was clicked on after choosing the spell
3434
npc: Npc;
3535
// The player performing the action.
@@ -48,11 +48,11 @@ export interface Magic_On_NPCAction {
4848
* @param widgetId
4949
* @param buttonId
5050
*/
51-
const buttonActionPipe = (npc:Npc, player: Player, widgetId: number, buttonId: number): RunnableHooks<Magic_On_NPCAction> => {
51+
const buttonActionPipe = (npc:Npc, player: Player, widgetId: number, buttonId: number): RunnableHooks<MagicOnNPCAction> => {
5252
//console.info(`pew pew you use magic on ${npc.name}!`);
5353

5454
// Find all object action plugins that reference this location object
55-
const matchingHooks = getActionHooks<Magic_On_NPCActionHook>('magic_on_npc');
55+
const matchingHooks = getActionHooks<MagicOnNPCActionHook>('magic_on_npc');
5656

5757

5858
return {

src/plugins/buttons/magic-attack.plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { gfxIds } from '@engine/world/config/gfx-ids';
77
import { loopingEvent } from '@engine/game-server';
88
import { TaskExecutor } from '@engine/world/action';
99
import { widgetButtonIds } from '../skills/smithing/smelting-constants';
10-
import { magic_on_npcActionHandler, Magic_On_NPCActionHook, Magic_On_NPCAction } from '../../game-engine/world/action/magic-on-npc.action';
10+
import { magiconnpcActionHandler, MagicOnNPCActionHook, MagicOnNPCAction } from '../../game-engine/world/action/magic-on-npc.action';
1111
import { logger } from '@runejs/core';
1212

1313
const buttonIds: number[] = [
@@ -20,7 +20,7 @@ function attack_target(player: Player, elapsedTicks: number): boolean {
2020
}
2121

2222
const spells = ['Wind Strike','Confuse', 'Water Strike','unknown?', 'Earth Strike'];
23-
export const activate = (task: TaskExecutor<Magic_On_NPCAction>, elapsedTicks: number = 0) => {
23+
export const activate = (task: TaskExecutor<MagicOnNPCAction>, elapsedTicks: number = 0) => {
2424
const {
2525
npc,
2626
player,
@@ -42,6 +42,6 @@ export default {
4242
activate,
4343
interval: 0
4444
}
45-
} as Magic_On_NPCActionHook
45+
} as MagicOnNPCActionHook
4646

4747
};

0 commit comments

Comments
 (0)