Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/dev/editor/conf/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@
value between 0 and 4, the higher, the more light does the object
emit.
</attribute>
<attribute arch="light_color" editor="light color" type="string">
The color emitted by a glowing object, written as exactly six
hexadecimal digits in RRGGBB form (for example, ffc080).
</attribute>
<attribute arch="z" editor="height" type="int">
Adjusts Y position of the object as it appears on the map.
</attribute>
Expand Down
1 change: 1 addition & 0 deletions arch/items/light/torch_wall/torch_wall.arc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type 74
face torch_wall.110
other_arch torch_wall_1_unlit
glow_radius 5
light_color ffc080
is_animated 1
animation torch_wall_1
is_turnable 1
Expand Down
1 change: 1 addition & 0 deletions arch/items/light/torch_wall_green/torch_wall_green.arc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type 74
face torch_wall_green.110
other_arch torch_wall_green_unlit
glow_radius 5
light_color 66ff66
is_animated 1
animation torch_wall_green
is_turnable 1
Expand Down
5 changes: 5 additions & 0 deletions arch/magic/forcefield/forcefield_blue/forcefield_blue.arc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type 77
layer 5
no_pick 1
glow_radius 5
light_color 4060ff
end

Object forcefield_blue_1
Expand All @@ -20,6 +21,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color 4060ff
end

Object forcefield_blue_3
Expand All @@ -32,6 +34,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color 4060ff
end

Object forcefield_blue_4
Expand All @@ -44,6 +47,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color 4060ff
end

Object forcefield_blue_8
Expand All @@ -56,4 +60,5 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color 4060ff
end
5 changes: 5 additions & 0 deletions arch/magic/forcefield/forcefield_red/forcefield_red.arc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type 77
layer 5
no_pick 1
glow_radius 5
light_color ff3030
end

Object forcefield_red_1
Expand All @@ -20,6 +21,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color ff3030
end

Object forcefield_red_3
Expand All @@ -32,6 +34,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color ff3030
end

Object forcefield_red_4
Expand All @@ -44,6 +47,7 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color ff3030
end

Object forcefield_red_8
Expand All @@ -56,4 +60,5 @@ type 77
layer 5
no_pick 1
glow_radius 4
light_color ff3030
end
1 change: 1 addition & 0 deletions contracts/content-v1/grammar-inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"layer",
"level",
"lifesave",
"light_color",
"luck",
"magic",
"make_ethereal",
Expand Down
40 changes: 40 additions & 0 deletions maps/python/tests/Atrinik_tests/Object.py
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,46 @@ def test_item_skill(self):
def test_glow_radius(self):
self.field_test_int("glow_radius", 8)

def test_light_color(self):
with self.assertRaises(TypeError):
self.obj.light_color = "ffffff"
for invalid in (-1, 0x1000000, 0xffffffff):
with self.assertRaises(OverflowError):
self.obj.light_color = invalid
self.assertEqual(self.obj.light_color, 0xffffff)

self.obj.light_color = 0
self.assertEqual(self.obj.light_color, 0)
saved = self.obj.Save()
self.assertEqual(saved, "arch sword\nlight_color 000000\nend\n")
loaded = Atrinik.LoadObject(saved)
self.assertEqual(loaded.light_color, 0)
loaded.Destroy()

self.obj.light_color = 0xffffff
self.assertEqual(self.obj.light_color, 0xffffff)
self.assertEqual(self.obj.Save(), "arch sword\nend\n")

self.obj.glow_radius = 8
m = Atrinik.CreateMap(5, 5, "test-atrinik-object-light-color")
m.Insert(self.obj, 2, 2)
for color in (0xff0000, 0x0000ff, 0xff0000):
self.obj.light_color = color
self.assertEqual(self.obj.light_color, color)
self.obj.Remove()

self.obj.InsertInto(activator)
self.obj.item_level = 0
self.obj.item_skill = 0
activator.Apply(self.obj)
self.assertTrue(self.obj.f_applied)
for color in (0x0000ff, 0xff0000):
self.obj.light_color = color
self.assertEqual(self.obj.light_color, color)
self.assertEqual(activator.light_color, color)
activator.Apply(self.obj)
self.assertFalse(self.obj.f_applied)

def test_move_status(self):
self.field_test_int("move_status", 8)

Expand Down
4 changes: 2 additions & 2 deletions maps/python/tests/Atrinik_tests/Player.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ def test_FindMarkedObject(self):
obj = self.pl.ob.CreateObject("sword")
self.assertIsNone(self.pl.FindMarkedObject())

# TODO: remove hard-coded command ID (15 = item mark command)
data = struct.pack("!HBI", 5, 15, obj.count)
# TODO: remove hard-coded command ID (14 = item mark command)
data = struct.pack("!HBI", 5, 14, obj.count)
self.pl.s_packet_recv_cmd += data
simulate_server(count=30, wait=False)
self.assertEqual(self.pl.FindMarkedObject(), obj)
Expand Down
6 changes: 3 additions & 3 deletions prototypes/authored-syntax-v1/baseline-lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema_version": 1,
"sha256": "135866c5ba80e30cf83aa0fce8ef6611ee4e48aadd6e9d11170c69b916a66f17",
"sha256": "8992734d7bd14a22a26c5852bcecfc5cf7eb115d72419f169cd81279bea53994",
"files": [
{
"path": "contracts/content-v1/consumer-inventory.json",
Expand Down Expand Up @@ -69,8 +69,8 @@
},
{
"path": "contracts/content-v1/grammar-inventory.json",
"bytes": 9937,
"sha256": "48ce57322609a06a82d6e5d95d3a4862f4b52ede5957588ad6fcbee55927435a"
"bytes": 9958,
"sha256": "c2ee095b94772191abbdfaac2e41b7af6e2f031edf06774fc5d16b94de973651"
}
]
}
3 changes: 2 additions & 1 deletion schemas/authored-content-v1/FIELDS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated authored-content fields

Do not edit this file directly. It is generated from
`schemas/authored-content-v1/source.json` (SHA-256 `2edc87fe007248e3c116a20ca4d95d3806371281339830eb7b2052285de7210f`).
`schemas/authored-content-v1/source.json` (SHA-256 `b1171af74a2c7e038dcbbedd44042f94e1395b0122ff24360b7a5eb45288e11c`).

| Field ID | Kind | Status | Roles | References |
| --- | --- | --- | --- | --- |
Expand Down Expand Up @@ -200,6 +200,7 @@ Do not edit this file directly. It is generated from
| `object.layer` | `integer` | `active` | `render` | — |
| `object.level` | `integer` | `active` | `general` | — |
| `object.lifesave` | `boolean` | `active` | `flag` | — |
| `object.light_color` | `string` | `active` | `render` | — |
| `object.luck` | `string` | `legacy-ignored` | `legacy` | — |
| `object.magic` | `integer` | `active` | `general` | — |
| `object.make_ethereal` | `boolean` | `active` | `flag` | — |
Expand Down
Loading