Skip to content

Commit 34ccdba

Browse files
committed
carried rat in tooltip
1 parent 372f5af commit 34ccdba

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

client/src/playback/Actions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
188188
// move the target onto the source adjust target's size using scale factor
189189
const src = round.bodies.getById(this.robotId)
190190
const target = round.bodies.getById(this.actionData.id()) // rat getting napped
191+
192+
target.carriedRobot = undefined
193+
src.carriedRobot = target.id
191194

192195
target.lastPos = { ...target.pos }
193196
target.pos = { x: src.pos.x + RatNapAction.OFFSET.x, y: src.pos.y + RatNapAction.OFFSET.y }

client/src/playback/Bodies.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ export class Body {
363363
public moveCooldown: number = 0
364364
public actionCooldown: number = 0
365365
public turningCooldown: number = 0
366+
public carriedRobot: number | undefined = undefined // id of carried robot
366367
public bytecodesUsed: number = 0
367368
public cheese: number = 0
368369

@@ -687,6 +688,7 @@ export class Body {
687688
`Move Cooldown: ${this.moveCooldown}`,
688689
`Action Cooldown: ${this.actionCooldown}`,
689690
`${this.robotType !== schema.RobotType.CAT ? 'Turning Cooldown: ' + this.turningCooldown : ''}`,
691+
`${this.carriedRobot !== undefined ? 'Carrying: ' + this.carriedRobot : ''}`,
690692
`Bytecodes Used: ${this.bytecodesUsed}${
691693
this.bytecodesUsed >= this.metadata.bytecodeLimit() ? ' <EXCEEDED!>' : ''
692694
}`

0 commit comments

Comments
 (0)