Advertisement
varkarrus

Untitled

Jun 15th, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1.  
  2. //INPUT
  3.  
  4. const modifier = (text) => {
  5.  
  6. let modifiedText = text
  7. const lowered = text.toLowerCase()
  8.  
  9. if(state.memory){
  10. var firstentry = worldEntries[Math.floor(Math.random()*worldEntries.length)].entry
  11. var secondentry = worldEntries[Math.floor(Math.random()*worldEntries.length)].entry
  12. state.memory.context = "You need to know "+firstentry+"\n. Also very important to know is "+secondentry+"\n"+state.basememory
  13. // state.message = state.memory.context;
  14. state.shouldShuffle = false;
  15. }
  16.  
  17. // You must return an object with the text property defined.
  18. return {text: modifiedText}
  19. }
  20.  
  21. // Don't modify this part
  22. modifier(text)
  23.  
  24. //OUTPUT
  25.  
  26. const modifier = (text) => {
  27.  
  28. let modifiedText = text
  29. const lowered = text.toLowerCase()
  30.  
  31. if(!state.initialized){
  32.  
  33. //let intro = history[0].text.split('. ').first;
  34. state.you = history[0].text.split('.')[0];
  35. state.equip = modifiedText.split('.')[0]; //TODO: Change this value if you edit history.
  36. state.basememory = state.you + ". You have: "+state.equip+".";
  37. if(!state.memory){
  38. state.memory = {context:state.basememory};
  39. }
  40. state.initialized = true;
  41. state.shouldShuffle = false;
  42. }
  43.  
  44. if(state.shouldShuffle == true){
  45. if(state.memory){
  46. var firstentry = worldEntries[Math.floor(Math.random()*worldEntries.length)].entry
  47. var secondentry = worldEntries[Math.floor(Math.random()*worldEntries.length)].entry
  48. state.memory.context = "You need to know "+firstentry+"\n. Also very important to know is "+secondentry+"\n"+state.basememory
  49. // state.message = state.memory.context
  50. }
  51. }
  52. state.shouldShuffle = true;
  53.  
  54. // You must return an object with the text property defined.
  55. return {text: modifiedText}
  56. }
  57.  
  58. // Don't modify this part
  59. modifier(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement