You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

37 rivejä
514 B

  1. define([
  2. ], function (
  3. ) {
  4. return {
  5. type: 'slowed',
  6. chance: 0.7,
  7. events: {
  8. beforeMove: function (targetPos) {
  9. if (Math.random() >= this.chance)
  10. return;
  11. targetPos.success = false;
  12. },
  13. beforeDealDamage: function (damage) {
  14. if (!damage)
  15. return;
  16. if (Math.random() >= this.chance)
  17. return;
  18. damage.failed = true;
  19. },
  20. beforeCastSpell: function (successObj) {
  21. if (Math.random() < this.chance)
  22. return;
  23. successObj.success = false;
  24. }
  25. }
  26. };
  27. });