move you self

This commit is contained in:
the me 2022-08-16 15:28:01 -07:00
parent 9cdac2b47e
commit 4d394955fa
18 changed files with 127 additions and 22 deletions

View file

@ -18,7 +18,7 @@
"physicsKinematic": false,
"physicsShapePoints": [],
"eventList": [
{"isDnD":false,"eventNum":0,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":64,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":72,"eventType":8,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},

View file

@ -3,7 +3,10 @@ var i;
/*for (i=0; i<array_length(global.units[ARMY.US]); i++) {
c_inheritunit(2+i, 2, un.chara);
}*/
var chara = c_inheritunit(2, 2, un.chara);
c_addweapon(chara, wp.knife, true);
c_inheritunit(3, 2, un.kris);
selectedunit = noone;
var chara = c_inheritunit(8, 5, un.chara);
c_addweapon(chara, wp.knife, false);
c_addweapon(chara, wp[$"iron sword"], true);
c_inheritunit(10, 5, un.kris);
selectedunit = noone;
global.gw = 640;
global.gh = 360;

View file

@ -0,0 +1,21 @@
if selectedunit != noone {
draw_set_color(c_black);
draw_rectangle(global.gw, global.gh, global.gw-100, global.gh-(array_length(selectedunit.inventory)-1)*32-16, false);
draw_set_color(c_white);
var i;
draw_set_halign(fa_right);
for (i=1; i<array_length(selectedunit.inventory); i++) {
draw_text(global.gw-10, global.gh-10-i*20, (selectedunit.equippedweapon == i ? "X " : " ") + selectedunit.inventory[i].name);
}
draw_set_halign(fa_left);
var dudes = c_getstats(selectedunit);
draw_set_color(c_black);
draw_rectangle(0, 0, 100, (array_length(dudes)-1)*32+16, false);
draw_set_color(c_white);
var i;
for (i=0; i<array_length(dudes); i++) {
draw_text(10, 10+i*20, dudes[i].name + ": " + string(dudes[i].val));
}
draw_set_halign(fa_left);
}

View file

@ -1,5 +1,5 @@
c_input();
if select && selectedunit == noone {
if select && selectedunit == noone {
var mousex = floor(mouse_x/global.tilesize.x);
var mousey = floor(mouse_y/global.tilesize.y);
log(mousex, mousey);
@ -14,4 +14,15 @@ if select && selectedunit == noone {
}
}
}
} else if select {
if mouse_x > global.gw-100 {
var guyhits = floor(abs(mouse_y-global.gh-10)/32);
log(guyhits, array_length(selectedunit.inventory));
if guyhits < array_length(selectedunit.inventory) {
//log("doing");
selectedunit.equippedweapon = guyhits+1;
c_equipweapon(selectedunit, selectedunit.inventory[selectedunit.equippedweapon]);
}
//draw_text(global.gw-10, global.gh-10-i*20;
}
}

View file

@ -11,6 +11,7 @@ attacked = 0;
inventory = [];
c_addweapon(id, wp.nothing);
equippedweapon = noone;
waiting = false;
continuecombat = function(me, them) {
//if stamina returnable = true stamina-- return true
@ -23,8 +24,14 @@ continuecombat = function(me, them) {
action = {
effect: function(me, them) {
them.data.hp.val -= me.data.str.val;
return me.data.str.val;
if irandom(99) < (me.data.hit.val) { //add avo
them.data.hp.val -= me.data.str.val;
return me.data.str.val;
} else {
log(string(me) + " missed!");
return 0;
}
}
//animation: new actionanim()

View file

@ -1,3 +1,4 @@
if waiting image_blend = c_grey else image_blend = c_white;
draw_self();
drawstate();
//log(data);