InjectionTestGame/dudes.c

21 lines
319 B
C

#include <stdlib.h>
#include "dudes.h"
struct dude* makeDude() {
struct dude* d = malloc(sizeof(struct dude));
d->hp = 100;
d->mp = 70;
d->atk = 5;
d->def = 2;
for(int i = 0; i < 10; i++) {
d->spells[i] = NULL;
}
return d;
}
void destroyDude(struct dude* d) {
free(d);
}