funnymummy1119

Untitled

Jul 18th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. x=room_width/2;
  2. ytext=240;
  3. color=make_colour_rgb(197,202,233);
  4.  
  5. //load text from language file
  6. text_multi = load_text("gameover","difmulti","Difficult multiplier: ")
  7. text_nextlv = load_text("gameover","untilnextlv","Until next LV")
  8.  
  9. //exp
  10.  
  11. ini_open("data.ini");
  12. ID = global.charID
  13. exp_gain = global.Score
  14. exp_multi = (1+global.startdif/40)
  15. str_multi = text_multi+string(exp_multi); //string for display
  16. str_expgain = string(exp_gain) +"x"+ string(exp_multi) +"=" +string(exp_gain * exp_multi) + " EXP"
  17.  
  18. global.charEXP[ID] += exp_gain * exp_multi //exp gained
  19. show_debug_message(global.charEXP[ID]);
  20.  
  21. ini_write_real("player",global.charname[ID]+"EXP",global.charEXP[ID]) //save data
  22.  
  23. global.islevelup = false;
  24. if global.charLV[ID] < 20 { //if not max level
  25.     exp_left = exp_require(global.charLV[ID]+1) - global.charEXP[ID]
  26.     str_expleft = text_nextlv+": "+ string(exp_left) //string for display
  27.     while exp_left <= 0 { //level up
  28.     global.islevelup = true;
  29.     global.charLV[ID] += 1;
  30.     exp_left = exp_require(global.charLV[ID]+1) - global.charEXP[ID]
  31.     ini_write_real("player",global.charname[ID]+"LV",global.charLV[ID]) //save data
  32.     }
  33. }
  34. ini_close();
Advertisement
Add Comment
Please, Sign In to add comment