Also is there a violent library for things like kill, hit, strangle, and so forth?
' "Self test"
' Created with QDK Pro 3.52
define game <Self test>
asl-version <350>
gametype singleplayer
start <startroom>
game info <Created with QDK Pro 3.52>
command <hit #@object#> if ( #object# = self ) then {
msg <You beat your self up.>
set numeric <injured; 1>
}
command <kill #@object#> {
msg <o.k. you kill yourself.|n|nyour dead.>
playerlose
}
command <feed banana to #@object#> if ( #object# = self ) then {
msg <You eat the banana.>
hide <banana>
}
define variable <injured>
type numeric
value <0>
display <injured: !>
end define
end define
define synonyms
eat banana; consume banana = use banana
end define
define room <inventory>
define object <self>
alt <me; myself>
look {
if ( %injured% = 0 ) then msg <You are in good shape.>
if ( %injured% = 1 ) then msg <You are in pretty bad shape, you need medical attention as soon as possible.>
}
speak <Do you talk to yourself a lot?>
invisible
drop nowhere <>
end define
end define
define room <startroom>
south {
msg <You step through the door and fall down a hole in the floor. Land hard in a pile of wood. You are seriously injured. You find yourself in a dark basement. The only thing you can see is a staircase leading up in the southeast corner.>
set numeric <injured; 1>
goto <basement>
}
end define
define room <basement>
prefix <the>
look <You are in a dark basement. Some light comes in through the hole above you that you just fell through. All you can make out is a staircase leading up.>
up {
msg <The staircase is very old and rickety but you decide to risk it. It shakes and seems very unsteady as you climb. It starts to collapse as you are about two thirds of the way up. You leap to the top and just make it as the stairs crumble beneath you.>
goto <kitchen>
}
end define
define room <kitchen>
define object <first aid kit>
look <A standard looking first aid kit.>
take
use {
if ( %injured% = 0 ) then msg <You have no use for the first aid kit right now.>
if ( %injured% = 1 ) then {
msg <You open up the kit and take care of your injuries. You feel much better.>
set numeric <injured; 0>
}
}
end define
define object <banana>
look <a big ripe yellow banana.>
take
use {
msg <You eat the banana.>
hide <banana>
}
use on <self> {
msg <You feed yourself the banana.>
hide <banana>
}
end define
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define
define variable <injured>
type numeric
value <0>
display <$injured$>
end define
define function <injured>
if (%injured% = 0) then return <You are not injured.>
if (%injured% = 1) then return <You are injured.>
end define
examine {
if ( %injured% = 0 ) then msg <You are in good shape.>
if ( %injured% = 1 ) then msg <You are in pretty bad shape, you need medical attention as soon as possible.>
exec <inventory>
}
define variable <injured>
type numeric
value <0>
display <$InjuredDisplay$>
end define
define function <InjuredDisplay>
if (%injured% = 0) then return <You are not injured.>
if (%injured% = 1) then return <You are injured.>
end define