Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weapon pitch: Moonlight Greatsword #320

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/common/types/item.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ export interface ItemData {
pet?: string;
effect?: string;
duration?: number;
activeAbility?: {
name: string; // Name of the active ability
manaCost: number; // Mana cost of the ability
cooldown: number; // Cooldown duration for the ability
};
}
26 changes: 26 additions & 0 deletions packages/server/data/abilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,32 @@
"type": "passive"
},

"moonbeam": {
"type": "active",
"levels": {
"1": {
"cooldown": 60000,
"duration": 20000,
"mana": 25
},
"2": {
"cooldown": 60000,
"duration": 20000,
"mana": 25
},
"3": {
"cooldown": 60000,
"duration": 20000,
"mana": 25
},
"4": {
"cooldown": 60000,
"duration": 20000,
"mana": 25
}
}
},

"secretcalling": {
"type": "active",
"levels": {
Expand Down
35 changes: 35 additions & 0 deletions packages/server/data/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,41 @@
"magic": -8
}
},

"moonlightgreatsword": {
"type": "weapon",
"name": "Moonlight Greatsword",
"weaponType": "sword",
"price": 5000,
"skill": "magic",
"level": 55,
"attackStats": {
"crush": 4,
"slash": 12,
"stab": 14,
"archery": 0,
"magic": 38
},
"defenseStats": {
"crush": 2,
"slash": 8,
"stab": 6,
"archery": 0,
"magic": 14
},
"bonuses": {
"accuracy": 0,
"strength": 0,
"archery": 0,
"magic": 27
},
"activeAbility": {
"name": "Moonbeam",
"manaCost": 25,
"cooldown": 60000
}
},

"bluelightsaber": {
"type": "weapon",
"name": "Blue Lightsaber",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import precognition from './precognition';
import run from './run';
import secretcalling from './secretcalling';
import thickskin from './thickskin';
import moonbeam from './moonbeam'

export default {
intimidate,
Expand All @@ -15,5 +16,6 @@ export default {
hotshot,
thickskin,
precognition,
secretcalling
secretcalling,
moonbeam
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import Ability from '../ability';

import type Player from '../../player';

export default class Moonbeam extends Ability {
public constructor(level: number, quickSlot = -1) {
super('moonbeam', level, quickSlot);
}

/**
* Implement Moonbeam's specific behavior here.
* @param player The player using the Moonbeam ability.
*/
public override activate(player: Player): boolean {
if (!player.hasTarget()) {
player.notify(`misc:NEED_COMBAT`);
return false;
}

return super.activate(player);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ export default class Equipments {
this.unequip(Modules.Equipment.Shield);
}

/**
* If the player is equipping the Moonlight Greatsword, then we add the skill Moonbeam
* to the player's abilities.
*/



/**
* Similarly to handling the two-handed weapon, we must also cover the case when the player tries
* to equip a shield while wielding a two-handed weapon. We must ensure that they have enough space
Expand Down