add walls destroyed stat
This commit is contained in:
parent
0aac6f780b
commit
9cf4304845
|
@ -77,7 +77,11 @@ internal sealed class CollideBullets(
|
||||||
{
|
{
|
||||||
var offsetPixel = new PixelPosition(x, y);
|
var offsetPixel = new PixelPosition(x, y);
|
||||||
if (options.Value.DestructibleWalls)
|
if (options.Value.DestructibleWalls)
|
||||||
|
{
|
||||||
map.Current.DestroyWallAt(offsetPixel);
|
map.Current.DestroyWallAt(offsetPixel);
|
||||||
|
owner.Scores.WallsDestroyed++;
|
||||||
|
}
|
||||||
|
|
||||||
TryHitTankAt(offsetPixel.ToFloatPosition(), owner);
|
TryHitTankAt(offsetPixel.ToFloatPosition(), owner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,4 +17,6 @@ internal sealed record class Scores(int Kills = 0, int Deaths = 0)
|
||||||
return Kills / (double)Deaths;
|
return Kills / (double)Deaths;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int WallsDestroyed { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,11 @@ export default function Scoreboard({}: {}) {
|
||||||
field: 'ratio',
|
field: 'ratio',
|
||||||
visualize: p => p.scores.ratio.toString(),
|
visualize: p => p.scores.ratio.toString(),
|
||||||
sorter: (a, b) => numberSorter(a.scores.ratio, b.scores.ratio)
|
sorter: (a, b) => numberSorter(a.scores.ratio, b.scores.ratio)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'walls',
|
||||||
|
visualize: p => p.scores.wallsDestroyed.toString(),
|
||||||
|
sorter: (a, b) => numberSorter(a.scores.wallsDestroyed, b.scores.wallsDestroyed)
|
||||||
}
|
}
|
||||||
]}/>
|
]}/>
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ export type Player = {
|
||||||
readonly scores: {
|
readonly scores: {
|
||||||
readonly kills: number;
|
readonly kills: number;
|
||||||
readonly deaths: number;
|
readonly deaths: number;
|
||||||
|
readonly wallsDestroyed: number;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue