disguise team
All checks were successful
CI / checks (push) Successful in 56s

This commit is contained in:
Robin Appelman 2025-06-29 14:38:26 +02:00
commit 7af264a85b
4 changed files with 27 additions and 8 deletions

View file

@ -42,7 +42,17 @@ export function MapRender(props: MapRenderProps) {
</pattern>
<pattern id="diagonalHatchBlue" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:8"/>
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:10"/>
</pattern>
<pattern id="diagonalHatchRedBlue" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#a75d50; stroke-width:12"/>
<line x1="8" y1="0" x2="8" y2="10" style="stroke:#5b818f; stroke-width:4"/>
</pattern>
<pattern id="diagonalHatchBlueRed" patternUnits="userSpaceOnUse" width="8" height="8"
patternTransform="rotate(45 0 0)">
<line x1="0" y1="0" x2="0" y2="10" style="stroke:#5b818f; stroke-width:12"/>
<line x1="8" y1="0" x2="8" y2="10" style="stroke:#a75d50; stroke-width:4"/>
</pattern>

View file

@ -63,8 +63,17 @@ export function Player(props: PlayerProp) {
return "none";
}
}
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`
const fill = () => props.player.cloaked ? teamHatch() : teamColor();
const teamHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRed)` : `url(#diagonalHatchBlue)`;
const teamDisguiseHatch = () => (props.player.team === Team.Red) ? `url(#diagonalHatchRedBlue)` : `url(#diagonalHatchBlueRed)`;
const fill = () => {
if (props.player.cloaked) {
return teamHatch();
}
if (props.player.playerClass === Class.Spy && (props.player.class_data as SpyState).disguise_team !== props.player.team && (props.player.class_data as SpyState).disguise_class > 0) {
return teamDisguiseHatch();
}
return teamColor();
};
return (
<g