alright, i'm trying to get an attack from a list of attacks the user has, then determine the damage with that.I know, i know, use the switch you say... but i don't know what the user will have. I have this code so far.
declaring list:
mob/var
list/att[1]
then, the input/list problem.
var/list/attacks = usr.att
var/attack = input(usr, "Which do you wish to do?", "Combat", "Attack") in attacks
var/damage = attacker.str / attack.dmg
so, i want this code to ask the player for an attack. then the damage var is determined by a variable of the attack. I get these errors:
battle.dm:123:error:attack.dmg:bad var
also, i could just determine the damage with a switch command, but it would make my fingers hurt to type out all the attacks in the game, and so on and so forth. There must be an easier way.
ID:179764
Nov 10 2001, 4:16 pm
|
|
attack doesn't have a dmg var.
To make it have that var, you need to make the var of the appropriate type.
Since I don't know what your attack type is, I'm just going to make assumptions here.
var/obj/attack