Skip to content

Commit 4fbdb62

Browse files
author
kazukinumazato
committed
ゲームバランス調整
1 parent c0b829d commit 4fbdb62

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

packages/web/src/component/game.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export class Weapon implements Entity {
161161
this.bulletSpeed = 10;
162162
this.reloadFrame = 10;
163163
this.bulletsLeft = 3;
164-
this.requiredStamina = 10;
164+
this.requiredStamina = 20;
165165
}
166166
}
167167

@@ -261,12 +261,12 @@ class World {
261261
runFightersAction(delta: number) {
262262
for (const fighter of this.fighters) {
263263
// スタミナ回復
264-
if (fighter.stamina < MAX_STAMINA) fighter.stamina += 1;
264+
if (fighter.stamina < MAX_STAMINA) fighter.stamina += 0.5;
265265
// スタミナ不足か判断後、アクションによってはスタミナ消費し実行
266266
if (!fighter.isShortOfStamina) {
267267
fighter.action?.tick(delta);
268268
if (fighter.stamina === 0) fighter.isShortOfStamina = true;
269-
} else if (fighter.stamina > MAX_STAMINA / 2) {
269+
} else if (fighter.stamina > MAX_STAMINA / 4) {
270270
fighter.isShortOfStamina = false;
271271
}
272272
}
@@ -391,14 +391,15 @@ class WalkToAction implements FighterAction {
391391

392392
destination: Vector2;
393393

394-
requiredStamina = 0;
394+
requiredStamina = 0.5;
395395

396396
constructor(fighter: Fighter, destination: Vector2) {
397397
this.actor = fighter;
398398
this.destination = destination;
399399
}
400400

401401
tick(delta: number) {
402+
if (this.actor.stamina <= 0) return;
402403
const vector2 = {
403404
x: this.destination.x - this.actor.location.x,
404405
y: this.destination.y - this.actor.location.y,
@@ -409,6 +410,7 @@ class WalkToAction implements FighterAction {
409410
this.actor.direction.x * this.actor.speed * delta * 0.1;
410411
this.actor.location.y +=
411412
this.actor.direction.y * this.actor.speed * delta * 0.1;
413+
this.actor.stamina = Math.max(this.actor.stamina - this.requiredStamina, 0);
412414
}
413415
}
414416

@@ -433,9 +435,9 @@ class RunToAction implements FighterAction {
433435
const normalizedVector = normalizeVector2(vector2);
434436
this.actor.direction = normalizedVector || this.actor.direction;
435437
this.actor.location.x +=
436-
this.actor.direction.x * (this.actor.speed + 1) * delta * 0.1;
438+
this.actor.direction.x * (this.actor.speed + 2) * delta * 0.1;
437439
this.actor.location.y +=
438-
this.actor.direction.y * (this.actor.speed + 1) * delta * 0.1;
440+
this.actor.direction.y * (this.actor.speed + 2) * delta * 0.1;
439441
this.actor.stamina = Math.max(this.actor.stamina - this.requiredStamina, 0);
440442
}
441443
}
@@ -447,7 +449,7 @@ class PunchAction implements FighterAction {
447449

448450
isCompleted = false;
449451

450-
requiredStamina = 21;
452+
requiredStamina = 20;
451453

452454
constructor(actor: Fighter, target: Fighter) {
453455
this.actor = actor;
@@ -475,14 +477,17 @@ class PickUpAction implements FighterAction {
475477

476478
target: Weapon;
477479

478-
requiredStamina = 0;
480+
requiredStamina = 10;
481+
482+
isFinished = false;
479483

480484
constructor(actor: Fighter, target: Weapon) {
481485
this.actor = actor;
482486
this.target = target;
483487
}
484488

485489
tick() {
490+
if (this.actor.stamina <= 0 || this.isFinished) return;
486491
const distance = calculateDistance(this.actor, this.target);
487492
if (distance <= Fighter.armLength) {
488493
this.actor.weapon = this.target;
@@ -493,6 +498,8 @@ class PickUpAction implements FighterAction {
493498
});
494499
this.actor.direction = vector2 || this.actor.direction;
495500
}
501+
this.actor.stamina = Math.max(this.actor.stamina - this.requiredStamina, 0);
502+
this.isFinished = true;
496503
}
497504
}
498505

0 commit comments

Comments
 (0)