The Dink Network

Reply to Re: How can I change the bow speed?

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
May 20th 2024, 08:07 PM
pq_knight.gif
ExDeathEvn
Peasant He/Him New Zealand rumble
"Skinny Legend" 
You'd want to start with looking at the bow item script (item-b1.c I think) to work out the calculations and how they work. What I'm seeing so far is the following as an excerpt from a bow in Charlie's Legacy, but I've added comments - these are mostly Assumptions however:

 activate_bow();
  &mypower = get_last_bow_power();
  
  if (&mypower < 100)
  {
    return;
  }
  &mholdx = sp_x(1, -1); //Save Dink's X coords
  &mholdy = sp_y(1, -1); //Save Dink'ys Y coords
  &mydir = sp_dir(1, -1); //Save Dink's direction

//Example direction, aiming Right
  if (&mydir == 4)
  {
    &mholdx -= 30;
    sp_x(&junk, &mholdx);
    sp_mx(&junk, -6);
  }
  //Calculations for the Charging stage of the bow appear to start in this section. Dividing numbers?
  &mypower /= 100;
  &mshadow = &mypower;
  &temp = &strength;
  &mydir = math_mod(&temp, 5);
  &temp /= 5;
  
  if (&temp == 0)
  {
    &temp = 1;
  }
  //Now we start to see Multiplying going on.
  &mypower *= &temp;
  
  if (&mshadow >= &mydir)
  {
    &mypower += &mydir;
  }
  
  sp_timing(&junk, 0);

if (&mshadow >= &mydir)
  {
    &mypower += &mydir;
  }
  
  sp_timing(&junk, 0);
  
  
  sp_custom("spellcaster", &junk, 1);
  &temp = random(6, 1);
  //The &temp random above appears to be the chance of a Power Shot, if Dink has Bow Lore for example.
  //In Charlie's Legacy the bow has different effects.

  if (&temp == 3)
  {
    //critical hit example
    &mypower * 3;
    playsound(44, 14050,0,0,0);
    
    say("`4* POWER SHOT *", 1);
  }
//This section is more for affecting the projectile, so probably AFTER shooting.
  sp_strength(&junk, &mypower);
  sp_range(&junk, 10);
  //this makes it easier to hit stuff
  sp_flying(&junk, 1);
  sp_script(&junk, "dam-a1");
  //when the projectile hits something, it will look to this script, this way
  &mshadow = create_sprite(&mholdx, &mholdy, 15, 432, 3);
  sp_brain_parm(&mshadow, &junk);
  sp_que(&mshadow, -500);
  sp_brain_parm(&junk, 1);
  sp_brain_parm2(&junk, &mshadow);
  sp_nohit(&mshadow, 1);