eastern-flames/eastern flames/scripts/unit/unit.gml

57 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-08-15 02:35:57 +00:00
//global.units = 5;
2022-08-15 17:51:51 +00:00
global.units = [[],[]];
2022-08-15 02:35:57 +00:00
enum ARMY {
US,
THEM,
}
//exit;
global.unitdata = {};
var mydata = {
name: "chara",
desc: "the first fallen human",
skills: ["SKILLS.LUNA"],
2022-08-16 02:04:23 +00:00
idle: s_momiji,
up: s_momijiup,
down: s_momijidown,
2022-08-15 02:35:57 +00:00
}
function unit(personaldata_, classdata_, stats_) constructor {
name = personaldata_.name;
2022-08-16 02:04:23 +00:00
idle = personaldata_.idle;
up = personaldata_.up;
down = personaldata_.down;
2022-08-15 17:51:51 +00:00
alignment = noone;
var i;
for (i=0; i<array_length(stats_); i++) {
self[$stats_[i].name] = stats_[i];
}
2022-08-15 02:35:57 +00:00
global.unitdata[$name] = self;
}
2022-08-16 01:01:09 +00:00
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(20), st.spd.add(5)]);
2022-08-15 17:51:51 +00:00
mydata = {
name: "kris",
desc: "totally kris",
skills: ["SKILLS.LUNA"],
2022-08-16 02:04:23 +00:00
idle: s_guy2,
up: s_guy2,
down: s_guy2,
2022-08-15 17:51:51 +00:00
}
2022-08-16 01:01:09 +00:00
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(20), st.spd.add(5)]);
2022-08-15 02:35:57 +00:00
function archetypedata() constructor {
//PERSONALDATA AND CLASSDATA ARE THE SAME THINGS
}
function c_addunit(unit, alignment) {
//log(5);
//log(global.units);
array_push(global.units[alignment], unit);
2022-08-15 17:51:51 +00:00
unit.alignment = alignment;
2022-08-15 02:35:57 +00:00
log(global.units[alignment]);
}
c_addunit(un.chara, ARMY.US);
#macro un global.unitdata