Advertisement
Guest User

Encounter

a guest
Mar 13th, 2020
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. -- A basic encounter script skeleton you can copy and modify for your own creations.
  2.  
  3. encountertext = "Chara bloquea el camino!" --Modify as necessary. It will only be read out in the action select screen.
  4. nextwaves = {}
  5. arenasize = {155, 130}
  6.  
  7. enemies = {
  8. "Chara (es)"
  9. }
  10.  
  11. enemypositions = {
  12. {0, 0}
  13. }
  14.  
  15. deathtext = {
  16. "[voice:v_sschara]E-ey! [w:10]Humano? [w:10]E-estas ahi?",
  17. "[voice:v_sschara][waitall:2][effect:shake,2]O-oh no..."
  18. }
  19.  
  20.  
  21. attacknum = 0
  22. caja = 0
  23. tartacount = 0
  24. nieve = 0
  25. turnonieve = 0
  26. -- A custom list with attacks to choose from. Actual selection happens in EnemyDialogueEnding(). Put here in case you want to use it.
  27. possible_attacks = {"bullettest_chaserorb"}
  28.  
  29. function EncounterStarting()
  30. -- If you want to change the game state immediately, this is the place.
  31. Audio.LoadFile("knifetrousle")
  32. Audio.Play("knifetrousle")
  33. Misc.WindowName = "StorySwap"
  34. Inventory.AddCustomItems({"Tarta", "Trz. Nieve x3", "Trz. Nieve x2", "Trz. Nieve", "Bipolo", "Unipolo", "Cnj. Canela x2", "Cnj. Canela"}, {0,0,0,0,0,0,0,0})
  35. Inventory.SetInventory({"Tarta", "Trz. Nieve x3", "Bipolo", "Cnj. Canela x2"})
  36. require "Animations/animchara"
  37. Player.name = "BLOOKY"
  38. end
  39.  
  40. function EnemyDialogueStarting()
  41. -- Good location for setting monster dialogue depending on how the battle is going.
  42. end
  43.  
  44. function Update()
  45. Player.hp = 20
  46. end
  47.  
  48. function EnemyDialogueEnding()
  49. attacknum = attacknum + 1
  50. if attacknum == 1 then
  51. nextwaves = {"wave1"}
  52. elseif attacknum == 2 then
  53. nextwaves = {"wave2"}
  54. elseif attacknum == 3 then
  55. nextwaves = {"wave3"}
  56. elseif attacknum == 4 then
  57. nextwaves = {"wave4"}
  58. elseif attacknum == 5 then
  59. nextwaves = {"wave5"}
  60. elseif attacknum == 6 then
  61. nextwaves = {"wave6"}
  62. elseif attacknum == 7 then
  63. nextwaves = {"wave7"}
  64. elseif attacknum == 8 then
  65. nextwaves = {"wave8"}
  66. elseif attacknum == 9 then
  67. nextwaves = {"final1"}
  68. elseif attacknum == 10 then
  69. nextwaves = {"nada"}
  70. end
  71. end
  72.  
  73. function DefenseEnding() --This built-in function fires after the defense round ends.
  74. end
  75.  
  76. function HandleSpare()
  77. State("ENEMYDIALOGUE")
  78. end
  79.  
  80. function HandleItem(ItemID)
  81. if ItemID == "TARTA" then
  82. Player.heal(999)
  83. BattleDialog({"Comes la Tarta.\r[w:5]Recuperas todo tu HP!"})
  84. elseif ItemID == "TRZ. NIEVE X3" then
  85. Player.heal(999)
  86. BattleDialog({"Comes el Trozo de Nieve.[w:5]\rRecuperas todo tu HP!"})
  87. Inventory.AddItem("Trz. Nieve x2", 3)
  88. elseif ItemID == "TRZ. NIEVE X2" then
  89. Player.heal(999)
  90. BattleDialog({"Comes el Trozo de Nieve.[w:5]\rRecuperas todo tu HP!"})
  91. Inventory.AddItem("Trz. Nieve", 3)
  92. elseif ItemID == "TRZ. NIEVE" then
  93. Player.heal(999)
  94. BattleDialog({"Comes el Trozo de Nieve.[w:5]\rRecuperas todo tu HP!"})
  95. elseif ItemID == "BIPOLO" then
  96. if Player.hp >= 9 then
  97. Player.heal(11)
  98. BattleDialog({"Comes la mitad del Bipolo.[w:5]\rRecuperas todo tu HP!"})
  99. Inventory.AddItem("Unipolo", 4)
  100. elseif Player.hp <= 8 then
  101. Player.heal(11)
  102. BattleDialog({"Comes la mitad del Bipolo.[w:5]\rRecuperas 11 de HP!"})
  103. end
  104. elseif ItemID == "UNIPOLO" then
  105. if Player.hp >= 9 then
  106. Player.heal(11)
  107. BattleDialog({"Comes la ultima mitad del Bipolo.[w:5]\rRecuperas todo tu HP!"})
  108. elseif Player.hp <= 8 then
  109. Player.heal(11)
  110. BattleDialog({"Comes la ultima mitad del Bipolo.[w:5]\rRecuperas 11 de HP!"})
  111. end
  112. elseif ItemID == "CNJ. CANELA X2" then
  113. Player.heal(999)
  114. BattleDialog({"Comes el Conejo de Canela.[w:5]\rRecuperas todo tu HP!"})
  115. Inventory.AddItem("Cnj. Canela", 5)
  116. elseif ItemID == "CNJ. CANELA" then
  117. Player.heal(999)
  118. BattleDialog({"Comes el Conejo de Canela.[w:5]\rRecuperas todo tu HP!"})
  119. end
  120. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement