dim char.10:dup clv,char.0:dup chp,char.1:dup catk,char.2:dup cdef,char.3
dup chit,char.4:dup cspd,char.5:dup catkitm,char.6:dup cdefitm,char.7
dup clatk,char.8:dup chatk,char.9:clv = 1:chp = 100:catk = 10:cdef = 5:chit = 50
cspd = 40:catkitm = 0:cdefitm = 0:clatk = (catk + (catkitm/2)):chatk = (catk + catkitm)
dim mons.10:dup mno,mons.0:dup mhp,mons.1:dup matk,mons.2
dup mdef,mons.3:dup mhit,mons.4:dup mspd,mons.5
mno = 1:mhp = 100:mlatk = 8:mhatk = 14:mdef = 4:mhit = 60:mspd = 40
*mainmes "charcter"+"LV:"+clv+" HP:"+chp+" atk:"+clatk+"-"+chatk+" def:"+cdef+" hit:"+chit+" spd:"+cspd
mes "monster: "+mhp:if (mhp <= 0) and (chp <= 0) :{dialog "引き分け" :end}
if mhp <= 0 :{dialog "あなたの勝ち" :end}:if chp <= 0 :{dialog "敵の勝ち" :end}
pos 0,100 : button ""+no,*attack:stop
*attackno+:randomize:pos 0,0 : cls:tempspdlen = 50 + (chit - mspd)
if tempspdlen > 0:rnd tempspd,100
if tempspd >= tempspdlen :{mes "自→敵 miss" : goto defence}
tempatk = 0:atklen = chatk - clatk:if atklen > 0 : rnd tempatk,atklen
tempatk += clatk:damage = tempatk - mdef:if damage <=0 : damage = 0
mhp = mhp - damage:mes "自→敵 damage: "+damage
*defencetempspdlen = 0:tempspdlen = 50 + (mhit - cspd)
if tempspdlen > 0:rnd tempspd,100
if tempspd >= tempspdlen :{mes "敵→自 miss" : goto main}
tempatk = 0:atklen = mhatk - mlatk:if atklen > 0 : rnd tempatk,atklen
tempatk += mlatk:damage = tempatk - cdef
if damage <=0 : damage = 0:chp = chp - damage
mes "敵→自 damage: "+damage:goto main