home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Special: Spiele Hits
/
Hits-CD.iso
/
aminet
/
spiele
/
ammud1_1.lha
/
AmigaMUD
/
Src
/
Proving
/
surface.m
< prev
next >
Wrap
Text File
|
1997-07-05
|
54KB
|
1,530 lines
/*
* Amiga MUD
*
* Copyright (c) 1997 by Chris Gray
*/
/*
* surface.m - surface level of the proving grounds.
*/
use t_streets
/*
* monsterDrink - used for the drinking troll and the drinking goblin.
* Half the time they will try to drink, other half will do normal stuff.
*/
define tp_proving proc monsterDrink()bool:
if FindName(Here()@p_rContents, p_oName, "water") = succeed and
Random(2) = 0
then
ignore Parse(G, "drink water");
else
DoMonsterMove(Me());
fi;
MonsterReschedule(Me());
true
corp;
define tp_proving tp_surface CreateTable()$
use tp_surface
define tp_surface proc monsterSet1(thing room)void:
InitMonsterModels(room, 300);
AddPossibleMonster(room, m_rat, 25);
AddPossibleMonster(room, m_snake, 25);
AddPossibleMonster(room, m_dog, 25);
AddPossibleMonster(room, m_gremlin, 25);
corp;
define tp_surface proc monsterSetP(thing room)void:
InitMonsterModels(room, 325);
AddPossibleMonster(room, m_rat, 20);
AddPossibleMonster(room, m_snake, 35);
AddPossibleMonster(room, m_dog, 20);
AddPossibleMonster(room, m_gremlin, 20);
AddPossibleMonster(room, m_deer, 25);
corp;
define tp_surface m_birds CreateMonsterModel("birds,bir;pair,of.pair",
"The birds sing nicely, but they are nothing special to look at.",
MonsterInit, RandomMove,
0, 20, 0, 0, 0, 0)$
GNewIcon(m_birds, makeBirdIcon())$
define tp_surface proc birdsHit(thing theBirds)void:
Print("The birds flutter out of reach.\n");
OPrint(Capitalize(CharacterNameG(Me())) +
" takes a swipe at the birds, but they flutter out of reach.\n");
corp;
m_birds@p_mFightAction := birdsHit$
/* Birds will sing once, then leave. Note that we do this a bit special,
not using the p_mSound property, since we want the birds to leave as
soon as they sing. */
define tp_surface BIRDS_SING_ID NextSoundEffectId()$
define tp_surface proc birdsSingOnce(thing client)void:
if SOn(client) then
SPlaySound(client, "birds", 1, BIRDS_SING_ID);
IfFound(client);
Else(client);
FailText(client, "The birds sing.");
Fi(client);
else
SPrint(client, "The birds sing.\n");
fi;
corp;
define tp_surface proc birdsSing()bool:
ForEachAgent(Here(), birdsSingOnce);
Me()@p_mMovesUntilVanish := 0;
MonsterReschedule(Me());
true
corp;
m_birds@p_mSpecialAction := birdsSing$
m_birds@p_Image := "Characters/birds"$
define tp_surface m_drinkingTroll CreateThing(m_troll)$
m_drinkingTroll@p_mSpecialAction := monsterDrink$
m_drinkingTroll@p_Image := "Characters/drinkingTroll"$
define tp_surface proc monsterSet2(thing room)void:
InitMonsterModels(room, 400);
AddPossibleMonster(room, m_wolf, 25);
AddPossibleMonster(room, m_blackBear, 25);
AddPossibleMonster(room, m_deer, 25);
AddPossibleMonster(room, m_moose, 25);
AddPossibleMonster(room, m_drinkingTroll, 25);
AddPossibleMonster(room, m_birds, 25);
corp;
define tp_surface r_warning CreateThing(r_outdoors)$
SetupRoom(r_warning, "on an east-west path", "")$
Connect(r_path2, r_warning, D_WEST)$
AutoGraphics(r_warning, AutoPaths)$
ExtendDesc(r_path2, "A sign reading 'To the Proving Grounds' points along "
"a path heading west.")$
Sign(r_path2, "sign;simple,painted,wooden",
"The sign is a simple painted wooden sign on a post.",
"To the Proving Grounds")$
Scenery(r_path2, "post.path.pathway")$
define tp_proving proc warning()status:
if not Me()@p_pInited then
Print(
"\nWARNING: The area to the west of here is a combat zone. If you chose to "
"enter that area, you may be subject to immediate attack. Entering the area "
"will enable combat for your character. Once enabled, combat cannot be "
"disabled.\n\n");
fi;
continue
corp;
AddWestChecker(r_path2, warning, false)$
/* Some generic rooms for this level of the proving grounds. */
define tp_surface r_provingRoad CreateThing(r_road)$
SetThingStatus(r_provingRoad, ts_readonly)$
AutoGraphics(r_provingRoad, AutoRoads)$
AutoPens(r_provingRoad, C_FOREST_GREEN, C_TAN, 0, 0)$
monsterSet1(r_provingRoad)$
define tp_surface r_provingField CreateThing(r_field)$
SetThingStatus(r_provingField, ts_readonly)$
monsterSet1(r_provingField)$
define tp_surface r_provingForest CreateThing(r_forest)$
SetThingStatus(r_provingForest, ts_readonly)$
monsterSet2(r_provingForest)$
Scenery(r_forest, "path.trail")$
define tp_surface r_entrance CreateThing(r_provingRoad)$
SetupRoom(r_entrance, "at the proving grounds entrance",
"A small, grimy tent is to the north, and a somewhat cleaner tent is "
"to the south. The path from the east turns into a cobbled road at "
"this point and continues to the west.")$
Connect(r_warning, r_entrance, D_WEST)$
r_warning@p_rNoMachines := true$
Scenery(r_entrance,
"tent;small,grimy,somewhat,clean,cleaner.path,pathway,road;cobbled")$
define tp_surface proc enterProvingGrounds()status:
if not Me()@p_pInited then
Print(
"Welcome to the proving grounds! You are hereby warned that "
"this area is not safe to just wander around in. It contains "
"monsters, etc. which will attempt to harm you. You should find "
"suitable weapons and armour to help protect yourself. You can "
"see your current statistics with the 'status' command.\n");
InitFighter(Me());
fi;
continue
corp;
AddWestChecker(r_warning, enterProvingGrounds, false)$
AddEastChecker(r_entrance, LeaveFighting, false)$
define tp_surface PR_ENTRANCE_ID NextEffectId()$
define tp_surface proc drawEntrance()void:
if not KnowsEffect(nil, PR_ENTRANCE_ID) then
DefineEffect(nil, PR_ENTRANCE_ID);
GSetImage(nil, "Proving/entrance");
IfFound(nil);
ShowCurrentImage();
Else(nil);
GSetPen(nil, C_FOREST_GREEN);
GAMove(nil, 0.0, 0.0);
GRectangle(nil, 0.5, 1.0, true);
GSetPen(nil, C_TAN);
GAMove(nil, 0.0, 0.38);
GRectangle(nil, 0.4, 0.24, true);
GAMove(nil, 0.37, 0.46);
GRectangle(nil, 0.131, 0.09, true);
GSetPen(nil, C_DARK_BLUE);
GAMove(nil, 0.06, 0.0);
GRectangle(nil, 0.37, 0.33, true);
GSetPen(nil, C_LEMON_YELLOW);
GAMove(nil, 0.06, 0.67);
GRectangle(nil, 0.37, 0.34, true);
GSetPen(nil, C_BRICK_RED);
GAMove(nil, 0.237, 0.33);
HorizontalDoor();
GAMove(nil, 0.237, 0.67);
HorizontalDoor();
Fi(nil);
EndEffect();
fi;
CallEffect(nil, PR_ENTRANCE_ID);
corp;
AutoGraphics(r_entrance, drawEntrance)$
/* Add an armoury to buy basic goods at */
define tp_surface r_armoury CreateThing(r_indoors)$
SetupRoom(r_armoury, "in an armoury",
"This small establishment is run by a nasty-looking individual who "
"appears to be his own best customer. He is a short, but very heavyset "
"man with a dirty beard and greasy hair. He wears armoured boots, heavy "
"chain gauntlets, plate mail and an iron helm. The handle of a huge "
"sword can be seen behind his head, and a couple of handy daggers are "
"tucked into a loose belt. Perhaps he doesn't trust his clientele.")$
Connect(r_entrance, r_armoury, D_NORTH)$
UniConnect(r_armoury, r_entrance, D_EXIT)$
AutoGraphics(r_armoury, AutoOpenRoom)$
r_armoury@p_rNoMachines := true$
r_armoury@p_Image := "Proving/armoury"$
Scenery(r_armoury,
"tent;small,grimy.armoury."
"man,individual,shopkeeper,storekeeper,armourer;"
"nasty-looking,nasty,looking,short,but,very,heavyset."
"beard,hair;dirty,greasy."
"boot;armoured."
"gauntlet,glove;heavy,chain."
"helm,helmet;iron."
"sword;huge."
"head."
"weapon;weaponry."
"handle;huge,sword."
"dagger;handy."
"belt;loose")$
MakeStore(r_armoury)$
WeaponSell(r_armoury, "dagger",
"The dagger is nothing special - just a large, heavy knife. The blade "
"is fairly sharp, and should last.",
10, 0, 0, 0, 0, 0, 6, 6)@p_Image := "Proving/dagger"$
define tp_proving o_stiletto WeaponSell(r_armoury,
"stiletto,stilleto,stileto,stilletto;fine",
"The stiletto is like a long dagger with a very narrow blade. It is "
"ideal for sticking into small places, like between ribs.",
15, 0, 0, 0, 0, 0, 8, 7)$
o_stiletto@p_Image := "Proving/stiletto"$
define tp_proving o_shortSword WeaponSell(r_armoury, "sword;short.shortsword",