unit sprites and a buncha other stuff

This commit is contained in:
the me 2022-08-15 19:04:23 -07:00
parent e45eb49492
commit a537ea5cf2
37 changed files with 516 additions and 17 deletions

View file

@ -3,7 +3,7 @@ function c_inheritunit(x, y, unit_) {
chump.data = unit_;
chump.pos.x = x;
chump.pos.y = y;
chump.sprite_index = unit_.sprite;
chump.sprite_index = unit_.idle;
array_push(global.map[x][y].contents, chump);
return chump;
}

View file

@ -16,6 +16,7 @@ function c_selectunit(unitobject) {
function c_deselectunit(unitobject) {
if ARTICULATOR.selectedunit != unitobject return false
unitobject.sprite_index = unitobject.data.idle;
state = st_standing;
drawstate = c_null;
c_decolor_all(c_cyan);

View file

@ -44,7 +44,7 @@ function st_moving() {
var guy = c_gettile(x, y, true);
c_colortile(guy.x, guy.y, c_green);
//log("selecting");
var rng = [1];
//var rng = [1];
var guy = c_gettile(x, y, true);
var hitting = noone;
if guy != noone {
@ -52,19 +52,30 @@ function st_moving() {
case DIR.LEFT:
hitting = c_gettile(guy.x-1, guy.y);
c_colortile(guy.x-1, guy.y, c_red);
sprite_index = data.down;
image_xscale = -1;
break;
case DIR.DOWN:
hitting = c_gettile(guy.x, guy.y+1);
c_colortile(guy.x, guy.y+1, c_red);
sprite_index = data.down;
break;
case DIR.UP:
hitting = c_gettile(guy.x, guy.y-1);
c_colortile(guy.x, guy.y-1, c_red);
sprite_index = data.up;
break;
case DIR.RIGHT:
hitting = c_gettile(guy.x+1, guy.y);
c_colortile(guy.x+1, guy.y, c_red);
sprite_index = data.down;
image_xscale = 1;
break;
default:
sprite_index = data.idle;
image_xscale = -1;
break;
}
if hitting != noone && select {
log("found one");

View file

@ -11,12 +11,16 @@ var mydata = {
name: "chara",
desc: "the first fallen human",
skills: ["SKILLS.LUNA"],
sprite: s_guy,
idle: s_momiji,
up: s_momijiup,
down: s_momijidown,
}
function unit(personaldata_, classdata_, stats_) constructor {
name = personaldata_.name;
sprite = personaldata_.sprite;
idle = personaldata_.idle;
up = personaldata_.up;
down = personaldata_.down;
alignment = noone;
var i;
for (i=0; i<array_length(stats_); i++) {
@ -31,7 +35,9 @@ mydata = {
name: "kris",
desc: "totally kris",
skills: ["SKILLS.LUNA"],
sprite: s_guy2,
idle: s_guy2,
up: s_guy2,
down: s_guy2,
}
nu unit(mydata, mydata, [st.hp.add(92), st.str.add(20), st.def.add(20), st.spd.add(5)]);

View file

@ -0,0 +1,28 @@
global.weapons = {};
#macro wp global.weapons
function weapon(name_, description_, statmod_) constructor {
name = name_;
description = description_;
statmod = statmod_;
}
function c_addweapon(target, weapon_) {
array_push(target.inventory, deep_copy(weapon_));
}
function c_modifierreset(target) {
var dudes = variable_struct_get_names(target.data);
var lads = variable_struct_get_names(st);
var i;
for (i=0; i<array_length(dudes); i++) {
while !array_contains(lads, dudes[i]) || dudes[i] == "hp" {
array_delete(dudes, i, 1);
}
if i > array_length(dudes) break;
target.data[$dudes[i]].val = target.data[$dudes[i]].cap;
}
}
function c_wpeval(target, weapon_) {
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "Scripts",
"path": "folders/Scripts.yy",
},
"resourceVersion": "1.0",
"name": "weapon",
"tags": [],
"resourceType": "GMScript",
}