Making an RPG with AGS: Difference between revisions
Jump to navigation
Jump to search
→Turn Based Fights: Weapons, Magics, Enemies, and Enemy A.I.
Line 81: | Line 81: | ||
---- | ---- | ||
''if (GetGlobalInt(5) <= 0) { | ''if (GetGlobalInt(5) <= 0) { | ||
GUIOff(4); | GUIOff(4); | ||
PlaySound(9); | PlaySound(9); | ||
NewRoom(30); //if the undead's HP is equal, or lesser than 0; then he dies and we go to another room in Asporia:Hidden Threat. You can use your own fight ending scripts. | NewRoom(30); //if the undead's HP is equal, or lesser than 0; then he dies and we go to another room in | ||
Asporia:Hidden Threat. You can use your own fight ending scripts. | |||
} | } | ||
else { | else { | ||
Line 89: | Line 92: | ||
PlaySound(1); | PlaySound(1); | ||
Wait(20); | Wait(20); | ||
Display("Undead hit you"); //if you couldn't kill the enemy, it will attack you and you will lose 3 HP. | Display("Undead hit you"); //if you couldn't kill the enemy, it will attack you and you will lose 3 HP. | ||
}'' | }'' | ||
Line 98: | Line 102: | ||
''if (game.score < 1) { | ''if (game.score < 1) { | ||
StopMusic(); | StopMusic(); | ||
Wait(40); | Wait(40); | ||
NewRoom(28); | NewRoom(28); | ||
}'' | }'' | ||
Line 124: | Line 130: | ||
''if (GetGlobalInt(4)>=60) { | ''if (GetGlobalInt(4)>=60) { | ||
Display("You leveled up and gained the magics of Cure +2, Fireball +2 and 6 mana points ."); | Display("You leveled up and gained the magics of Cure +2, Fireball +2 and 6 mana points ."); | ||
AddInventory(10); | AddInventory(10); | ||
AddInventory(11); | AddInventory(11); | ||
LoseInventory(4); //losing the old Cure +1 magic | LoseInventory(4); //losing the old Cure +1 magic | ||
SetGlobalInt(2,GetGlobalInt(2)+6); | SetGlobalInt(2,GetGlobalInt(2)+6); | ||
}'' | }'' | ||
Line 145: | Line 153: | ||
Then in the end of the game, | Then in the end of the game, | ||
''Wait(120); | ''Wait(120);'' | ||
if (GetGlobalInt(12)>=3) { | ''if (GetGlobalInt(12)>=3) {'' | ||
Wait(40); | ''Wait(40);'' | ||
NewRoom(62); | ''NewRoom(62);'' | ||
} | ''}'' | ||
if (GetGlobalInt(12)<3) { | ''if (GetGlobalInt(12)<3) {'' | ||
Wait(40); | ''Wait(40);'' | ||
NewRoom(57); | ''NewRoom(57);'' | ||
} | ''}'' | ||
'' | |||
The room 62 leads you to the good ending in the game. And the room 57 is to another ending which isn't good... | The room 62 leads you to the good ending in the game. And the room 57 is to another ending which isn't good... | ||
Line 160: | Line 168: | ||
If you think your game may be found too hard by some players, then you can add some cheats. To on_key_press; | If you think your game may be found too hard by some players, then you can add some cheats. To on_key_press; | ||
'' | |||
if (keycode==13) SetGlobalInt(2,GetGlobalInt(2)+10); | ''if (keycode==13) SetGlobalInt(2,GetGlobalInt(2)+10);'' | ||
'' | |||
If the player presses Ctrl + M, his/her mana increases for 10 points. | If the player presses Ctrl + M, his/her mana increases for 10 points. | ||