Add war axes, melee weapon bonuses, and tinderbox lighting overlay.
War axes craft from three bars plus a handle; swords/axes/clubs keep distinct strength and weapon-skill curves, and firestarting shows the tinderbox equip sprite.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
The contents of this binary file are not shown.
@@ -2213,13 +2213,11 @@ export class WorldView
2213
2213
if (!this.bloomEnabled)
2214
2214
{ continue; }
2215
2215
overlay.transform.rotation = walkTilt;
2216
this.#syncLitSprite(
2217
overlay,
2218
tileShade,
2219
flashStrength,
2220
wade,
2221
entity.bloomOverlayTints?.[index] ?? entity.bodyTint ?? null
2222
);
2216
const bloomTint = entity.bloomOverlayTints?.[index] ?? entity.bodyTint ?? null;
2217
if (bloomTint)
2218
{ this.#syncUnlitTintSprite(overlay, bloomTint); }
2219
else
2220
{ this.#syncLitSprite(overlay, tileShade, flashStrength, wade); }
2223
2221
this.#placePivoted(overlay, pivotX, pivotY, pivotY + 0.002, SORT_ENTITY, entity.visualScale ?? 1);
2224
2222
}
2225
2223
this.#placeHpBar(entity, pivotX, pivotY);
@@ -2236,6 +2234,25 @@ export class WorldView
2236
2234
object.renderer.secondaryMap = null;
2237
2235
}
2238
2236
2237
/** Bloom / unlit overlays that still need magenta channel tint (e.g. elemental sprites). */
2238
#syncUnlitTintSprite (object, tintColor)
2239
{
2240
if (!object?.renderer || !tintColor)
2241
{ return; }
2242
const tint = normalizeRgb(tintColor);
2243
const height = object.renderer.sprite?.height ?? SPRITE_SIZE_PX;
2244
object.renderer.shader = getTintLitSpriteShader();
2245
object.renderer.shaderUniforms = {
2246
u_darkness: 0,
2247
u_strength: 0,
2248
u_wade: 0,
2249
u_spriteHeight: height,
2250
u_useTint: 1,
2251
u_tintColor: [tint.r, tint.g, tint.b]
2252
};
2253
object.renderer.secondaryMap = null;
2254
}
2255
2239
2256
#syncLitSprite (object, darkness, flashStrength = 0, wade = false, tintColor = null)
2240
2257
{
2241
2258
if (!object?.renderer || object._lit === false)
@@ -2213,13 +2213,11 @@ export class WorldView2213
if (!this.bloomEnabled)2213
if (!this.bloomEnabled)2214
{ continue; }2214
{ continue; }2215
overlay.transform.rotation = walkTilt;2215
overlay.transform.rotation = walkTilt;2216
this.#syncLitSprite(2216
const bloomTint = entity.bloomOverlayTints?.[index] ?? entity.bodyTint ?? null;2217
overlay,2217
if (bloomTint)2218
tileShade,2218
{ this.#syncUnlitTintSprite(overlay, bloomTint); }2219
flashStrength,2219
else2220
wade,2220
{ this.#syncLitSprite(overlay, tileShade, flashStrength, wade); }2221
entity.bloomOverlayTints?.[index] ?? entity.bodyTint ?? null2222
);2223
this.#placePivoted(overlay, pivotX, pivotY, pivotY + 0.002, SORT_ENTITY, entity.visualScale ?? 1);2221
this.#placePivoted(overlay, pivotX, pivotY, pivotY + 0.002, SORT_ENTITY, entity.visualScale ?? 1);2224
}2222
}2225
this.#placeHpBar(entity, pivotX, pivotY);2223
this.#placeHpBar(entity, pivotX, pivotY);@@ -2236,6 +2234,25 @@ export class WorldView2236
object.renderer.secondaryMap = null;2234
object.renderer.secondaryMap = null;2237
}2235
}2238
2236
2237
/** Bloom / unlit overlays that still need magenta channel tint (e.g. elemental sprites). */2238
#syncUnlitTintSprite (object, tintColor)2239
{2240
if (!object?.renderer || !tintColor)2241
{ return; }2242
const tint = normalizeRgb(tintColor);2243
const height = object.renderer.sprite?.height ?? SPRITE_SIZE_PX;2244
object.renderer.shader = getTintLitSpriteShader();2245
object.renderer.shaderUniforms = {2246
u_darkness: 0,2247
u_strength: 0,2248
u_wade: 0,2249
u_spriteHeight: height,2250
u_useTint: 1,2251
u_tintColor: [tint.r, tint.g, tint.b]2252
};2253
object.renderer.secondaryMap = null;2254
}2255
2239
#syncLitSprite (object, darkness, flashStrength = 0, wade = false, tintColor = null)2256
#syncLitSprite (object, darkness, flashStrength = 0, wade = false, tintColor = null)2240
{2257
{2241
if (!object?.renderer || object._lit === false)2258
if (!object?.renderer || object._lit === false)@@ -143,7 +143,7 @@ function playerCombatLevels (ecs, handle, profile, settings = null)
143
143
bonuses[SkillId.mind] = (bonuses[SkillId.mind] ?? 0) + (status.mind ?? 0);
144
144
145
145
return {
146
hitLevel: skillLevel(skills, profile.hitSkillId ?? SkillId.unarmed),
146
hitLevel: effectiveSkillLevel(skills, profile.hitSkillId ?? SkillId.unarmed, bonuses),
147
147
damageLevel: effectiveSkillLevel(skills, profile.damageSkillId ?? SkillId.strength, bonuses),
148
148
agilityLevel: effectiveSkillLevel(skills, SkillId.agility, bonuses),
149
149
defenceLevel: effectiveSkillLevel(skills, SkillId.defence, bonuses)
@@ -143,7 +143,7 @@ function playerCombatLevels (ecs, handle, profile, settings = null)143
bonuses[SkillId.mind] = (bonuses[SkillId.mind] ?? 0) + (status.mind ?? 0);143
bonuses[SkillId.mind] = (bonuses[SkillId.mind] ?? 0) + (status.mind ?? 0);144
144
145
return {145
return {146
hitLevel: skillLevel(skills, profile.hitSkillId ?? SkillId.unarmed),146
hitLevel: effectiveSkillLevel(skills, profile.hitSkillId ?? SkillId.unarmed, bonuses),147
damageLevel: effectiveSkillLevel(skills, profile.damageSkillId ?? SkillId.strength, bonuses),147
damageLevel: effectiveSkillLevel(skills, profile.damageSkillId ?? SkillId.strength, bonuses),148
agilityLevel: effectiveSkillLevel(skills, SkillId.agility, bonuses),148
agilityLevel: effectiveSkillLevel(skills, SkillId.agility, bonuses),149
defenceLevel: effectiveSkillLevel(skills, SkillId.defence, bonuses)149
defenceLevel: effectiveSkillLevel(skills, SkillId.defence, bonuses)@@ -1,22 +1,25 @@
1
1
import { GAIT, CHUNK_SIZE } from "../../../shared/protocol/constants.js";
2
import {
3
mobCanFight,
4
mobSkillLevels,
5
mobHealthForLevel,
6
mobSpellCastChancePercent
7
} from "../../../shared/definitions/mobCombat.js";
8
import {
9
normalizeSpawnerConfig,
10
listAmbientMobTypes,
11
mobDefinition,
12
mobSpriteName,
13
MobId,
14
spawnerEquipmentSlot,
15
isTownGuardMob,
16
isHumanoidMob
17
} from "../../../shared/definitions/mobs.js";
2
import
3
{
4
mobCanFight,
5
mobSkillLevels,
6
mobHealthForLevel,
7
mobSpellCastChancePercent
8
} from "../../../shared/definitions/mobCombat.js";
9
import
10
{
11
normalizeSpawnerConfig,
12
listAmbientMobTypes,
13
mobDefinition,
14
mobSpriteName,
15
MobId,
16
spawnerEquipmentSlot,
17
isTownGuardMob,
18
isHumanoidMob
19
} from "../../../shared/definitions/mobs.js";
18
20
import { spellDefinition, SPRITE_BOLT_SPELL_BY_ELEMENT } from "../../../shared/definitions/spells.js";
19
21
import { MAGIC_ELEMENT_ORDER, magicElementTint } from "../../../shared/definitions/attackTypes.js";
22
import { essenceElementDisplayName } from "../../../shared/definitions/essenceItems.js";
20
23
import { LeatherItemId } from "../../../shared/definitions/leatherItems.js";
21
24
import { CENTRAL_EXCHANGE_STAFF } from "../../../shared/market/exchange.js";
22
25
import { emptyEquipment } from "../../../shared/items/inventory.js";
@@ -238,14 +241,21 @@ export function mobComponents (request)
238
241
}
239
242
240
243
let element = request.element ?? null;
241
if (def.randomElementOnSpawn && !element)
244
if ((def.randomElementOnSpawn || def.mobTypeId === MobId.sprite) && !element)
242
245
{
243
246
element = MAGIC_ELEMENT_ORDER[Math.floor(Math.random() * MAGIC_ELEMENT_ORDER.length)];
244
247
}
245
248
if (element)
246
249
{
247
appearance.tint = magicElementTint(element);
250
const tint = magicElementTint(element);
251
appearance.tint = { r: tint.r, g: tint.g, b: tint.b };
248
252
appearance.bloomBody = !!def.bloomBody;
253
if (def.mobTypeId === MobId.sprite || def.randomElementOnSpawn)
254
{
255
const label = essenceElementDisplayName(element);
256
appearance.firstName = `${label} Sprite`;
257
appearance.lastName = "";
258
}
249
259
}
250
260
251
261
const maxHp = mobHealthForLevel(def, level);
@@ -1,22 +1,25 @@1
import { GAIT, CHUNK_SIZE } from "../../../shared/protocol/constants.js";1
import { GAIT, CHUNK_SIZE } from "../../../shared/protocol/constants.js";2
import {2
import3
mobCanFight,3
{4
mobSkillLevels,4
mobCanFight,5
mobHealthForLevel,5
mobSkillLevels,6
mobSpellCastChancePercent6
mobHealthForLevel,7
} from "../../../shared/definitions/mobCombat.js";7
mobSpellCastChancePercent8
import {8
} from "../../../shared/definitions/mobCombat.js";9
normalizeSpawnerConfig,9
import10
listAmbientMobTypes,10
{11
mobDefinition,11
normalizeSpawnerConfig,12
mobSpriteName,12
listAmbientMobTypes,13
MobId,13
mobDefinition,14
spawnerEquipmentSlot,14
mobSpriteName,15
isTownGuardMob,15
MobId,16
isHumanoidMob16
spawnerEquipmentSlot,17
} from "../../../shared/definitions/mobs.js";17
isTownGuardMob,18
isHumanoidMob19
} from "../../../shared/definitions/mobs.js";18
import { spellDefinition, SPRITE_BOLT_SPELL_BY_ELEMENT } from "../../../shared/definitions/spells.js";20
import { spellDefinition, SPRITE_BOLT_SPELL_BY_ELEMENT } from "../../../shared/definitions/spells.js";19
import { MAGIC_ELEMENT_ORDER, magicElementTint } from "../../../shared/definitions/attackTypes.js";21
import { MAGIC_ELEMENT_ORDER, magicElementTint } from "../../../shared/definitions/attackTypes.js";22
import { essenceElementDisplayName } from "../../../shared/definitions/essenceItems.js";20
import { LeatherItemId } from "../../../shared/definitions/leatherItems.js";23
import { LeatherItemId } from "../../../shared/definitions/leatherItems.js";21
import { CENTRAL_EXCHANGE_STAFF } from "../../../shared/market/exchange.js";24
import { CENTRAL_EXCHANGE_STAFF } from "../../../shared/market/exchange.js";22
import { emptyEquipment } from "../../../shared/items/inventory.js";25
import { emptyEquipment } from "../../../shared/items/inventory.js";@@ -238,14 +241,21 @@ export function mobComponents (request)238
}241
}239
242
240
let element = request.element ?? null;243
let element = request.element ?? null;241
if (def.randomElementOnSpawn && !element)244
if ((def.randomElementOnSpawn || def.mobTypeId === MobId.sprite) && !element)242
{245
{243
element = MAGIC_ELEMENT_ORDER[Math.floor(Math.random() * MAGIC_ELEMENT_ORDER.length)];246
element = MAGIC_ELEMENT_ORDER[Math.floor(Math.random() * MAGIC_ELEMENT_ORDER.length)];244
}247
}245
if (element)248
if (element)246
{249
{247
appearance.tint = magicElementTint(element);250
const tint = magicElementTint(element);251
appearance.tint = { r: tint.r, g: tint.g, b: tint.b };248
appearance.bloomBody = !!def.bloomBody;252
appearance.bloomBody = !!def.bloomBody;253
if (def.mobTypeId === MobId.sprite || def.randomElementOnSpawn)254
{255
const label = essenceElementDisplayName(element);256
appearance.firstName = `${label} Sprite`;257
appearance.lastName = "";258
}249
}259
}250
260
251
const maxHp = mobHealthForLevel(def, level);261
const maxHp = mobHealthForLevel(def, level);