Jump to content
  • 0

Damage depending on range


Scylla

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

Hello, i would like to ask if there's a function / way to define damage that depends on its range to the target

 

Thank you!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  1443
  • Reputation:   338
  • Joined:  10/17/12
  • Last Seen:  

think this already exist in KN_CHARGEATK

 

unit.c

		case KN_CHARGEATK: {
			unsigned int k = (distance_bl(src,target)-1)/3; // +100% every 3 cells of distance

			if( k > 2 )
				k = 2; // ...but hard-limited to 300%.

			casttime += casttime * k;
		}

battle.c

		case KN_CHARGEATK: { // +100% every 3 cells of distance but hard-limited to 500%
				unsigned int k = wd.miscflag / 3;

				if (k < 2)
					k = 0;
				else if (k > 1 && k < 3)
					k = 1;
				else if (k > 2 && k < 4)
					k = 2;
				else if (k > 3 && k < 5)
					k = 3;
				else
					k = 4;
				skillratio += 100 * k;
			}
			break;
Edited by Stolao
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

 

think this already exist in KN_CHARGEATK

 

unit.c

		case KN_CHARGEATK: {
			unsigned int k = (distance_bl(src,target)-1)/3; // +100% every 3 cells of distance

			if( k > 2 )
				k = 2; // ...but hard-limited to 300%.

			casttime += casttime * k;
		}

battle.c

		case KN_CHARGEATK: { // +100% every 3 cells of distance but hard-limited to 500%
				unsigned int k = wd.miscflag / 3;

				if (k < 2)
					k = 0;
				else if (k > 1 && k < 3)
					k = 1;
				else if (k > 2 && k < 4)
					k = 2;
				else if (k > 3 && k < 5)
					k = 3;
				else
					k = 4;
				skillratio += 100 * k;
			}
			break;

 

Oh hey thank you very much for the reply! 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...