P3 alpha: wolf moon every 7th night, the alpha breaks wooden doors, iron-banded door, broken-door repair, alpha pelt and cloak (protocol 7)
This commit is contained in:
@@ -18,6 +18,7 @@ static func build(kind: String) -> Dictionary:
|
||||
"rabbit": d = _rabbit()
|
||||
"deer": d = _deer()
|
||||
"wolf": d = _wolf()
|
||||
"alpha": d = _wolf(true)
|
||||
_: d = _boar()
|
||||
_cache[kind] = d
|
||||
return d
|
||||
@@ -100,13 +101,42 @@ static func _boar() -> Dictionary:
|
||||
|
||||
## Grey wolf: lean body, long snout, pointed ears, bushy tail. "eyes" is a
|
||||
## separate mesh so it can glow (creature.gd gives it an emissive material).
|
||||
static func _wolf() -> Dictionary:
|
||||
var coat := Color(0.42, 0.42, 0.44)
|
||||
var pale := Color(0.72, 0.71, 0.68)
|
||||
## `alpha`: a third bigger, near-black with a grizzled ruff and a scarred
|
||||
## muzzle (wolf moon nights).
|
||||
static func _wolf(alpha: bool = false) -> Dictionary:
|
||||
if alpha:
|
||||
return _scaled(_wolf_parts(Color(0.17, 0.16, 0.17), Color(0.5, 0.48, 0.45), 241), 1.32)
|
||||
return _wolf_parts(Color(0.42, 0.42, 0.44), Color(0.72, 0.71, 0.68), 231)
|
||||
|
||||
## The same parts scaled up `k` times (body, eyes and leg meshes, hips, radius, height).
|
||||
static func _scaled(d: Dictionary, k: float) -> Dictionary:
|
||||
var out := d.duplicate()
|
||||
for key in ["body", "eyes", "leg"]:
|
||||
if d.has(key):
|
||||
out[key] = _scale_mesh(d[key], k)
|
||||
var hips: Array = []
|
||||
for h: Vector3 in d.hips:
|
||||
hips.append(h * k)
|
||||
out.hips = hips
|
||||
out.radius = float(d.radius) * k
|
||||
out.height = float(d.height) * k
|
||||
return out
|
||||
|
||||
static func _scale_mesh(m: ArrayMesh, k: float) -> ArrayMesh:
|
||||
var arrays := m.surface_get_arrays(0)
|
||||
var v: PackedVector3Array = arrays[Mesh.ARRAY_VERTEX]
|
||||
for i in range(v.size()):
|
||||
v[i] *= k
|
||||
arrays[Mesh.ARRAY_VERTEX] = v
|
||||
var out := ArrayMesh.new()
|
||||
out.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
|
||||
return out
|
||||
|
||||
static func _wolf_parts(coat: Color, pale: Color, seed: int) -> Dictionary:
|
||||
var dark := Color(0.16, 0.15, 0.15)
|
||||
var st := P._begin()
|
||||
var r := _rng(231)
|
||||
var n := _noise(231, 1.5)
|
||||
var r := _rng(seed)
|
||||
var n := _noise(seed, 1.5)
|
||||
P._blob(st, Vector3(0, 0.7, 0.05), Vector3(0.22, 0.24, 0.55), n, 0.15, coat, r, 1)
|
||||
P._blob(st, Vector3(0, 0.8, -0.32), Vector3(0.24, 0.26, 0.3), n, 0.25, P._mul(coat, 1.08), r, 1) # ruff
|
||||
P._blob(st, Vector3(0, 0.6, -0.1), Vector3(0.16, 0.12, 0.35), n, 0.1, pale, r, 1) # belly
|
||||
@@ -120,6 +150,6 @@ static func _wolf() -> Dictionary:
|
||||
var est := P._begin()
|
||||
for s in [-1.0, 1.0]:
|
||||
P._blob(est, Vector3(s * 0.065, 0.97, -0.75), Vector3.ONE * 0.022, n, 0.0, Color(1.0, 0.8, 0.3), r, 0)
|
||||
return {"body": P._commit(st), "eyes": P._commit(est), "leg": _leg(0.52, 0.045, 0.03, coat, dark, 232),
|
||||
return {"body": P._commit(st), "eyes": P._commit(est), "leg": _leg(0.52, 0.045, 0.03, coat, dark, seed + 1),
|
||||
"hips": [Vector3(-0.11, 0.52, -0.38), Vector3(0.11, 0.52, -0.38), Vector3(-0.11, 0.54, 0.38), Vector3(0.11, 0.54, 0.38)],
|
||||
"radius": 0.32, "height": 1.0}
|
||||
|
||||
Reference in New Issue
Block a user