mirror of
https://github.com/Sheldan/canvas.git
synced 2026-04-15 20:16:33 +00:00
survivors: adding spear (kinda)
changed range calculation for melee weapons
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type {ChanceEntry, Item} from "./interfaces.ts";
|
||||
import {Player} from "./Player.ts";
|
||||
import {randomItem} from "./utils.ts";
|
||||
import {ChainBall, HomingPistol, Pistol, SpreadWeapon} from "./weapons.ts";
|
||||
import {ChainBall, HomingPistol, Pistol, Spear, SpreadWeapon} from "./weapons.ts";
|
||||
import type {World} from "./World.ts";
|
||||
|
||||
export enum Rarity {
|
||||
@@ -42,6 +42,7 @@ export class ItemManagement {
|
||||
this.ITEMS.push(new SpreadWeaponItem())
|
||||
this.ITEMS.push(new ChainBallWeaponItem())
|
||||
this.ITEMS.push(new PullRangeUp())
|
||||
this.ITEMS.push(new SpearWeaponItem())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,4 +188,20 @@ export class ChainBallWeaponItem extends BaseItem {
|
||||
}
|
||||
}
|
||||
|
||||
export class SpearWeaponItem extends BaseItem {
|
||||
pickup(player: Player, world: World) {
|
||||
player.addWeapon(Spear.createSpear(world))
|
||||
super.pickup(player, world)
|
||||
}
|
||||
|
||||
name() {
|
||||
return 'spear'
|
||||
}
|
||||
|
||||
getRarity(): Rarity {
|
||||
return Rarity.EPIC;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user