064_initKik 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # initKik
  2. set init = speed + reakt
  3. set initKoef = init * 20/100
  4. set initi = rand(initi - initKoef, initi + initKoef)
  5. set initV = speedV + reaktV
  6. set initKoefV = initV * 20/100
  7. set initiV = rand(initiV - initKoefV, initiV + initKoefV)
  8. if initi > initiV and hodtime < 3 and ionce = 0 or hodtimeV >= 3 and ionce = 0:
  9. set hod = 0
  10. set hodtime += 1
  11. if hodtimeV >= 3:set hodtimeV = 0
  12. '<font color="green">You took the initiative</font>'
  13. set ionce = 1
  14. end
  15. if initi < initiV and hodtimeV < 3 and ionce = 0 or hodtime >= 3 and ionce = 0:
  16. set hod = 1
  17. set hodtimeV += 1
  18. if hodtime >= 3:set hodtime = 0
  19. '<font color="red"><<$nameV>> took the initiative</font>'
  20. set ionce = 1
  21. end
  22. if initi = initiV and hodtime < 3 and hodtimeV < 3 and ionce = 0:
  23. set inrand = rand(0, 1)
  24. set ionce = 1
  25. if inrand = 0:
  26. set hod = 0
  27. set hodtime += 1
  28. '<font color="green">You took the lead</font>'
  29. end
  30. if inrand = 1:
  31. set hod = 1
  32. set hodtimeV += 1
  33. '<font color="red"><<$nameV>> took the initiative</font>'
  34. end
  35. end
  36. if initi = initiV and hodtime >= 3 and ionce = 0 or initi = initiV and hodtimeV >= 3 and ionce = 0:
  37. set hodtime = 0
  38. set hodtimeV = 0
  39. set inrand = rand(0, 1)
  40. set ionce = 1
  41. if inrand = 0:
  42. set hod = 0
  43. set hodtime += 1
  44. '<font color="green">You took the lead</font>'
  45. end
  46. if inrand = 1:
  47. set hod = 1
  48. set hodtimeV += 1
  49. '<font color="red"><<$nameV>> took the initiative</font>'
  50. end
  51. end
  52. --- initKik ---------------------------------