Guest User

Untitled

a guest
Dec 1st, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. return function(newENV)
  2. _ENV = newENV
  3. ----- DO NOT MODIFY ABOVE -----
  4.  
  5. -- A basic Enemy Entity script skeleton you can copy and modify for your own creations.
  6. comments = { "Smells like the work of an enemy stand.", "Poseur is posing like his life depends on it.", "Poseur's limbs shouldn't be moving in this way." }
  7. commands = { "Check", "Talk", "Flirt", "Pose", "Working?" }
  8. randomdialogue = {
  9. { "Check it out.", "Please" },
  10. { "Check it out again.", "...", "For real now" },
  11. { "I'll show you something.", "Trust me." },
  12. { "Keep looking!", "Harder!", "I SAID HARDER!" },
  13. "It's working."
  14. }
  15.  
  16. AddAct("Check", "", 0)
  17. AddAct("Talk", "Little chit-chat", 0)
  18. AddAct("Flirt", "Seduce the enemy", 0, { "Kris" })
  19. AddAct("Pose", "Show him who's cool!", 5, { "Ralsei" })
  20. AddAct("Working?", "Is this working?", 50, { "Ralsei" })
  21.  
  22. hp = 250
  23. atk = 10
  24. def = 2
  25. dialogbubble = "DRBubble" -- See documentation for what bubbles you have available.
  26. canspare = false
  27. check = "Check message goes here."
  28.  
  29. -- CYK variables
  30. mag = 9001 -- MAGIC stat of the enemy
  31. targetType = "single" -- Specifies how many (or which) target(s) this enemy's bullets will target
  32. tired = false -- If true, the Player will be able to spare this enemy using the spell "Pacify"
  33.  
  34. -- Check the "Special Variables" page of the documentation to learn how to modify this mess
  35.  
  36. animations = {
  37. Hurt = { { H0 }, 1 , { next = "Idle" } },
  38. Idle = { { B0, B1, B2, B3, B4, B5, B6 }, 1 / 15, { } },
  39. Spareable = { { S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, S10, S11, S12, S13, S14 }, 1 / 15, { } },
  40. }
  41.  
  42. -- Triggered just before computing an attack on this target
  43. function BeforeDamageCalculation(attacker, damageCoeff)
  44. -- Good location to set the damage dealt to this enemy using self.SetDamage()
  45. if damageCoeff > 0 then
  46. --SetDamage(666)
  47. end
  48. end
  49.  
  50. -- Triggered when a Player attacks (or misses) this enemy in the ATTACKING state
  51. function HandleAttack(attacker, attackstatus)
  52. if currentdialogue == nil then
  53. currentdialogue = { }
  54. end
  55.  
  56. if attackstatus == -1 then
  57. -- Player pressed fight but didn't press Z afterwards
  58. table.insert(currentdialogue, "Do no harm, " .. attacker.name .. ".\n")
  59. else
  60. -- Player did actually attack
  61. if attackstatus < 50 then
  62. table.insert(currentdialogue, "You're strong, " .. attacker.name .. "!\n")
  63. else
  64. table.insert(currentdialogue, "Too strong, " .. attacker.name .. "...\n")
  65. end
  66. end
  67. end
  68.  
  69. posecount = 0
  70.  
  71. -- Triggered when a Player uses an Act on this enemy.
  72. -- You don't need an all-caps version of the act commands here.
  73. function HandleCustomCommand(user, command)
  74. local text = { "" }
  75. if command == "Check" then
  76. text = { name .. " - " .. atk .. " ATK " .. def .. " DEF\n" .. check }
  77. elseif command == "Talk" then
  78. if not tired then
  79. table.insert(comments, "Poseur has trouble staying up.")
  80. end
  81. tired = true
  82. currentdialogue = {"... *yawns*"}
  83. text = {"You try to talk with Poseur, but all you seem to be able to do is make him yawn."}
  84. elseif command == "Flirt" then
  85. currentdialogue = {"Thank you."}
  86. text = {"You tell Poseur you like his hairstyle.\nHe doesn't seem to mind."}
  87. elseif command == "Pose" then
  88. if posecount == 0 then
  89. currentdialogue = {"Not bad."}
  90. text = {"You posed dramatically."}
  91. elseif posecount == 1 then
  92. currentdialogue = {"Not bad at all...!"}
  93. text = {"You posed even more dramatically."}
  94. else
  95. if not canspare then
  96. table.insert(comments, "Poseur is impressed by your posing power.")
  97. end
  98. currentdialogue = {"That's it...!"}
  99. text = {"You posed so dramatically your anatomy became incorrect."}
  100. canspare = true
  101. SetCYKAnimation("Idle") -- Refresh the animation
  102. end
  103. posecount = posecount + 1
  104. elseif command == "Working?" then
  105. currentdialogue = {"Good one."}
  106. text = {"Is this working?", "[func:SetFaceSprite,Players.Ralsei.Mad][voice:v_ralsei]IT'S WORKING!!!", "Poseur smiles and seems to calm down."}
  107. canspare = true
  108. SetCYKAnimation("Idle") -- refresh the animation
  109. end
  110. BattleDialog(text)
  111. end
  112.  
  113. -- Function called whenever this entity's animation is changed.
  114. -- Make it return true if you want the animation to be changed like normal, otherwise do your own stuff here!
  115. function HandleAnimationChange(newAnim)
  116. local oldAnim = self.sprite["currAnim"]
  117. if newAnim == "Idle" and canspare then
  118. SetCYKAnimation("Spareable")
  119. return false
  120. end
  121. end
  122.  
  123. ----- DO NOT MODIFY BELOW -----
  124. end
Add Comment
Please, Sign In to add comment