mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
medic charge level circle
This commit is contained in:
parent
bdc35d0907
commit
225f008b63
1 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import {Class, PlayerState, SpyState, Team, WorldBoundaries} from "../Data/Parser";
|
import {Class, MedicState, PlayerState, SpyState, Team, WorldBoundaries} from "../Data/Parser";
|
||||||
|
|
||||||
export interface PlayerProp {
|
export interface PlayerProp {
|
||||||
player: PlayerState;
|
player: PlayerState;
|
||||||
|
|
@ -52,7 +52,16 @@ export function Player(props: PlayerProp) {
|
||||||
const transform = () => `translate(${scaledX()} ${scaledY()}) scale(${1 / props.scale})`;
|
const transform = () => `translate(${scaledX()} ${scaledY()}) scale(${1 / props.scale})`;
|
||||||
const rotate = () => `rotate(${270 - props.player.angle})`;
|
const rotate = () => `rotate(${270 - props.player.angle})`;
|
||||||
const filter = () => props.player.ubered ? ((props.player.team === Team.Red) ? 'url(#sofGlowRed)' : 'url(#sofGlowBlue)') : '';
|
const filter = () => props.player.ubered ? ((props.player.team === Team.Red) ? 'url(#sofGlowRed)' : 'url(#sofGlowBlue)') : '';
|
||||||
const circleStrokeStyle = () => props.player.playerClass === Class.Spy ? `${(props.player.class_data as SpyState).cloak} 100` : "none";
|
const circleStrokeStyle = () => {
|
||||||
|
switch (props.player.playerClass) {
|
||||||
|
case Class.Medic:
|
||||||
|
return `${(props.player.class_data as MedicState).charge} 100`
|
||||||
|
case Class.Spy:
|
||||||
|
return `${(props.player.class_data as SpyState).cloak} 100`
|
||||||
|
default:
|
||||||
|
return "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`
|
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`
|
||||||
const fill = () => props.player.cloaked ? teamHatch() : teamColor();
|
const fill = () => props.player.cloaked ? teamHatch() : teamColor();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue