File Makefile changed (mode: 100644) (index 9beea70..c97bf66) |
... |
... |
MAPSDIR="Maps/$(NAME)/" |
28 |
28 |
vpath *.j src:$(BUILDDIR) |
vpath *.j src:$(BUILDDIR) |
29 |
29 |
|
|
30 |
30 |
include src/Makefile |
include src/Makefile |
31 |
|
include Makefile.config |
|
|
31 |
|
sinclude Makefile.config |
|
32 |
|
sinclude test/Makefile |
32 |
33 |
|
|
33 |
34 |
build: $(BUILDDIR)/$(NAMEFULL).w3x $(BUILDDIR)/war3map.j |
build: $(BUILDDIR)/$(NAMEFULL).w3x $(BUILDDIR)/war3map.j |
34 |
35 |
$(PJASS) $(PJASS_OPTS) "$(BUILDDIR)/war3map.j" |
$(PJASS) $(PJASS_OPTS) "$(BUILDDIR)/war3map.j" |
|
... |
... |
$(BUILDDIR): |
45 |
46 |
mkdir -p "$(BUILDDIR)" |
mkdir -p "$(BUILDDIR)" |
46 |
47 |
|
|
47 |
48 |
$(BUILDDIR)/war3map.j: $(BUILDDIR) src/jass_include.m4 $(SNIPPETS) |
$(BUILDDIR)/war3map.j: $(BUILDDIR) src/jass_include.m4 $(SNIPPETS) |
48 |
|
$(PJASS) $(PJASS_OPTS) $(SNIPPETS) |
|
49 |
|
$(M4) --debug=aeqp -I $(BASEDIR) src/jass_include.m4 $(SNIPPETS) > "$(BUILDDIR)/war3map.j" |
|
|
49 |
|
$(PJASS) $(PJASS_OPTS) $(SNIPPETS) $(TESTS) |
|
50 |
|
$(M4) --debug=aeqp -I $(BASEDIR) src/jass_include.m4 $(SNIPPETS) $(TESTS) > "$(BUILDDIR)/war3map.j" |
50 |
51 |
|
|
51 |
52 |
$(BUILDDIR)/$(NAMEASSEMBLY).zip: .git/HEAD |
$(BUILDDIR)/$(NAMEASSEMBLY).zip: .git/HEAD |
52 |
53 |
$(GIT) archive --format zip --output "$(BUILDDIR)/$(NAMEASSEMBLY).zip" --prefix "$(NAME)/" HEAD |
$(GIT) archive --format zip --output "$(BUILDDIR)/$(NAMEASSEMBLY).zip" --prefix "$(NAME)/" HEAD |
File test/test.j added (mode: 100644) (index 0000000..4a8da53) |
|
1 |
|
// jass_module(`TEST_TEST_J') |
|
2 |
|
// jass_include(`SRC_ABLA_J', `src/abla.j') |
|
3 |
|
// jass_include(`SRC_ADUM_J', `src/adum.j') |
|
4 |
|
// jass_include(`SRC_ATUN_J', `src/atun.j') |
|
5 |
|
|
|
6 |
|
globals |
|
7 |
|
|
|
8 |
|
// test/test.j fields |
|
9 |
|
|
|
10 |
|
constant integer TEST_USER_ID = 0 |
|
11 |
|
constant integer TEST_ARCANE_SORCERER_UNIT_TYPE_ID = 'H001' |
|
12 |
|
endglobals |
|
13 |
|
|
|
14 |
|
// test/test.j functions |
|
15 |
|
|
|
16 |
|
function test_enemy_pool_get takes nothing returns unitpool |
|
17 |
|
local unitpool pool = null |
|
18 |
|
|
|
19 |
|
set pool = CreateUnitPool() |
|
20 |
|
|
|
21 |
|
call UnitPoolAddUnitType(pool, 'earc', 50.0) |
|
22 |
|
call UnitPoolAddUnitType(pool, 'nwat', 40.0) |
|
23 |
|
call UnitPoolAddUnitType(pool, 'edoc', 25.0) |
|
24 |
|
call UnitPoolAddUnitType(pool, 'edry', 25.0) |
|
25 |
|
|
|
26 |
|
return pool |
|
27 |
|
endfunction |
|
28 |
|
|
|
29 |
|
function test_enemy_init takes location o returns nothing |
|
30 |
|
local unitpool pool = null |
|
31 |
|
local integer i = 0 |
|
32 |
|
local integer q = 12 |
|
33 |
|
local player p = null |
|
34 |
|
local real x = 0.0 |
|
35 |
|
local real y = 0.0 |
|
36 |
|
local unit u = null |
|
37 |
|
|
|
38 |
|
if o == null then |
|
39 |
|
return |
|
40 |
|
endif |
|
41 |
|
|
|
42 |
|
set pool = test_enemy_pool_get() |
|
43 |
|
set p = Player(3) |
|
44 |
|
set x = GetLocationX(o) |
|
45 |
|
set y = GetLocationY(o) |
|
46 |
|
|
|
47 |
|
loop |
|
48 |
|
exitwhen i >= q |
|
49 |
|
set u = PlaceRandomUnit(pool, p, x, y, bj_UNIT_FACING) |
|
50 |
|
call UnitShareVision(u, Player(TEST_USER_ID), true) |
|
51 |
|
set i = i + 1 |
|
52 |
|
endloop |
|
53 |
|
|
|
54 |
|
call DestroyUnitPool(pool) |
|
55 |
|
endfunction |
|
56 |
|
|
|
57 |
|
function test_init takes nothing returns nothing |
|
58 |
|
local player p = null |
|
59 |
|
local integer start = 0 |
|
60 |
|
local location o = null |
|
61 |
|
local integer utype = 0 |
|
62 |
|
local unit h = null |
|
63 |
|
|
|
64 |
|
set p = Player(TEST_USER_ID) |
|
65 |
|
|
|
66 |
|
set start = GetPlayerStartLocation(p) |
|
67 |
|
set o = GetStartLocationLoc(start) |
|
68 |
|
|
|
69 |
|
set utype = TEST_ARCANE_SORCERER_UNIT_TYPE_ID |
|
70 |
|
set h = CreateUnitAtLoc(p, utype, o, bj_UNIT_FACING) |
|
71 |
|
call SetHeroLevel(h, 10, false) |
|
72 |
|
call SetUnitState(h, UNIT_STATE_MANA, GetUnitState(h, UNIT_STATE_MAX_MANA)) |
|
73 |
|
call SetUnitUseFood(h, false) |
|
74 |
|
|
|
75 |
|
if p == GetLocalPlayer() then |
|
76 |
|
call ClearSelection() |
|
77 |
|
call SelectUnit(h, true) |
|
78 |
|
endif |
|
79 |
|
|
|
80 |
|
call MoveLocation(o, GetStartLocationX(start) - 512.0 * 3, GetStartLocationY(start) - 512.0 * 3) |
|
81 |
|
call test_enemy_init(o) |
|
82 |
|
|
|
83 |
|
call RemoveLocation(o) |
|
84 |
|
endfunction |