survivors: adding pull range upgrade

renaming dagger to chain ball
increasing returning speed for chain ball
This commit is contained in:
Sheldan
2025-09-07 15:06:40 +02:00
parent 33310100f7
commit 70130f47a4
4 changed files with 28 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
import type {ChanceEntry, Item} from "./interfaces.ts";
import {Player} from "./Player.ts";
import {randomItem} from "./utils.ts";
import {Dagger, HomingPistol, Pistol, SpreadWeapon} from "./weapons.ts";
import {ChainBall, HomingPistol, Pistol, SpreadWeapon} from "./weapons.ts";
import type {World} from "./World.ts";
export enum Rarity {
@@ -40,7 +40,8 @@ export class ItemManagement {
this.ITEMS.push(new HomingPistolItem())
this.ITEMS.push(new PistolItem())
this.ITEMS.push(new SpreadWeaponItem())
this.ITEMS.push(new DaggerWeaponItem())
this.ITEMS.push(new ChainBallWeaponItem())
this.ITEMS.push(new PullRangeUp())
}
}
@@ -96,6 +97,21 @@ export class SpeedUp extends BaseItem {
}
}
export class PullRangeUp extends BaseItem {
pickup(player: Player, world: World) {
player.stats.pullRange *= 1.1
super.pickup(player, world)
}
name() {
return 'pull range'
}
getRarity(): Rarity {
return Rarity.COMMON;
}
}
export class HealthUp extends BaseItem {
pickup(player: Player, world: World) {
player.stats.health += 1
@@ -156,14 +172,14 @@ export class SpreadWeaponItem extends BaseItem {
}
}
export class DaggerWeaponItem extends BaseItem {
export class ChainBallWeaponItem extends BaseItem {
pickup(player: Player, world: World) {
player.addWeapon(Dagger.createDagger(world))
player.addWeapon(ChainBall.createChainBall(world))
super.pickup(player, world)
}
name() {
return 'dagger'
return 'chain ball'
}
getRarity(): Rarity {