Advertisement
ZoriaRPG

Link Vars and Other ZScript Hooks to Evaluate

Dec 9th, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.88 KB | None | 0 0
  1. <Link->Eaten
  2.  
  3. //link.h
  4.  inlikelike; // 1 = Like Like. 2 = Taking damage while trapped
  5.  
  6.     int getEaten();
  7.     void setEaten(int i);
  8.    
  9.     void stopCaneOfByrna();
  10.    
  11.     void red_shift(); //is this link death>
  12.    
  13.     //LINK.CPP
  14.    
  15.     int link_animation_speed = 1; //lower is faster animation
  16.    
  17.     //void LinkClass::linkstep() { lstep = lstep<(BSZ?27:11) ? lstep+1 : 0; }
  18. void LinkClass::linkstep()
  19. {
  20.     lstep = lstep<((zinit.linkanimationstyle==las_bszelda)?27:11) ? lstep+1 : 0;
  21. }
  22.  
  23.  
  24. stomping=false;
  25. didstuff, //played the whistle? used the blue candle?
  26.  reset_swordcharge();
  27.   blowcnt,  //number of times whistle blown on this screen.
  28. void checktouchblk();
  29. bool edge_of_dmap(int side);
  30.  void getTriforce(int id);
  31.  void ganon_intro();
  32.     void saved_Zelda();
  33.  virtual void drawshadow(BITMAP* dest, bool translucent);
  34.    int  getLStep();
  35.     int  getCharging();
  36.     void setCharging(int new_charging);
  37.     bool isCharged();
  38.     int  getAttackClk();
  39.     void  setAttackClk(int new_clk);
  40.     int  getSwordClk();
  41.     int  getItemClk();
  42.     void  setSwordClk(int newclk);
  43.     void  setItemClk(int newclk);
  44.     fix  getModifiedX();
  45.     fix  getModifiedY();
  46.     int  getDir();
  47.     void setDir(int new_dir);
  48.     int  getHitDir();
  49.     void setHitDir(int new_dir);
  50.     int  getClk();
  51.     int  getPushing();
  52.     bool getClock();
  53.     void setClock(bool state)
  54.     void setHClk(int newhclk);
  55.     int getHClk();
  56.     void setNayrusLoveShieldClk(int newclk);
  57.     int getNayrusLoveShieldClk();
  58.     int getHoverClk();
  59.     int getHoldClk();
  60.     void do_lens();
  61. int touchcombo(int x,int y);
  62.  
  63. //These have handlers, but no ZASM?
  64. void LinkClass::setNayrusLoveShieldClk(int newclk)
  65. {
  66.     NayrusLoveShieldClk=newclk;
  67.    
  68.     if(decorations.idCount(dNAYRUSLOVESHIELD)==0)
  69.     {
  70.         decoration *dec;
  71.         decorations.add(new dNayrusLoveShield(LinkX(), LinkY(), dNAYRUSLOVESHIELD, 0));
  72.         decorations.spr(decorations.Count()-1)->misc=0;
  73.         decorations.add(new dNayrusLoveShield(LinkX(), LinkY(), dNAYRUSLOVESHIELD, 0));
  74.         dec=(decoration *)decorations.spr(decorations.Count()-1);
  75.         decorations.spr(decorations.Count()-1)->misc=1;
  76.     }
  77. }
  78.  
  79. int LinkClass::getNayrusLoveShieldClk()
  80. {
  81.     return NayrusLoveShieldClk;
  82. }
  83.  
  84. int LinkClass::getHoverClk()
  85. {
  86.     return hoverclk;
  87. }
  88.  
  89. int LinkClass::getHoldClk()
  90. {
  91.     return holdclk;
  92. }
  93.  
  94. int  LinkClass::getLStep()
  95. {
  96.     return lstep;
  97. }
  98. int  LinkClass::getCharging()
  99. {
  100.     return charging;
  101. }
  102. bool LinkClass::isCharged()
  103. {
  104.     return spins>0;
  105. }
  106. int  LinkClass::getAttackClk()
  107. {
  108.     return attackclk;
  109. }
  110. void  LinkClass::setAttackClk(int new_clk)
  111. {
  112.     attackclk=new_clk;
  113. }
  114. void LinkClass::setCharging(int new_charging)
  115. {
  116.     charging=new_charging;
  117. }
  118. int  LinkClass::getSwordClk()
  119. {
  120.     return swordclk;
  121. }
  122. int  LinkClass::getItemClk()
  123. {
  124.     return itemclk;
  125. }
  126. void LinkClass::setSwordClk(int newclk)
  127. {
  128.     swordclk=newclk;
  129. }
  130. void LinkClass::setItemClk(int newclk)
  131. {
  132.     itemclk=newclk;
  133. }
  134.  
  135.  
  136. int  LinkClass::getClk()
  137. {
  138.     return clk;
  139. }
  140. int  LinkClass::getPushing()
  141. {
  142.     return pushing;
  143. }
  144. void LinkClass::Catch()
  145. {
  146.     if(!inwallm && (action==none || action==walking))
  147.     {
  148.         action=attacking;
  149.         attackclk=0;
  150.         attack=wCatching;
  151.     }
  152. }
  153.  
  154. bool LinkClass::getClock()
  155. {
  156.     return superman;
  157. }
  158. void LinkClass::setClock(bool state)
  159. {
  160.     superman=state;
  161. }
  162.  
  163. hoverclk
  164.  
  165.  linktile(&tile, &flip, &extend, is_moving()?ls_swim:ls_float, dir, zinit.linkanimationstyle);
  166. tile += anim_3_4(lstep,7)*(extend==2?2:1);
  167.  
  168. item_tile_mod(shieldModify); //LTm
  169.  
  170.  
  171. hitshield=true;//ifa weapon hits links shield
  172.  
  173. hclk //determines if link was hit. inv frames
  174.  
  175. inwallm //in a wallmaster]]
  176. NayrusLoveShieldClk
  177. heart_beep //bool? determines if the beep playsa
  178. heart_beep_timer
  179.  cont_sfx(WAV_ER); //hardcoded sfx
  180.  
  181.  
  182. sfx(WAV_OUCH,pan(int(x))); // we need to change this, to be able to play sound 0, or disable ita
  183.  
  184. paymagiccost(itemid); //Modify this with an extra version that counts by 30 frames
  185.  
  186. void do_lens()
  187.  
  188.  
  189.  
  190. void do_lens()
  191. {
  192.     int itemid = lensid >= 0 ? lensid : directWpn>-1 ? directWpn : current_item_id(itype_lens);
  193.    
  194.     if(itemid<0)
  195.         return;
  196.        
  197.     if(isWpnPressed(itype_lens) && !LinkItemClk() && !lensclk && checkmagiccost(itemid))
  198.     {
  199.         if(lensid<0)
  200.         {
  201.             lensid=itemid;
  202.            
  203.             if(get_bit(quest_rules,qr_MORESOUNDS)) sfx(itemsbuf[itemid].usesound);
  204.         }
  205.        
  206.         paymagiccost(itemid);
  207.        
  208.         if(dowpn>=0 && itemsbuf[dowpn].script != 0 && !did_scriptl)
  209.         {
  210.             ZScriptVersion::RunScript(SCRIPT_ITEM, itemsbuf[dowpn].script, dowpn & 0xFFF);
  211.             did_scriptl=true;
  212.         }
  213.        
  214.         lensclk = 12;
  215.     }
  216.     else
  217.     {
  218.         did_scriptl=false;
  219.        
  220.         if(lensid>-1 && !(isWpnPressed(itype_lens) && !LinkItemClk() && checkmagiccost(itemid)))
  221.         {
  222.             lensid=-1;
  223.             lensclk = 0;
  224.            
  225.             if(get_bit(quest_rules,qr_MORESOUNDS)) sfx(WAV_ZN1LENSOFF);
  226.         }
  227.     }
  228. }
  229.  
  230. autostep
  231.    pushing=push+1;
  232. is_on_conveyor
  233. slowcharging ^ slowcombo
  234. can_deploy_ladder()
  235. void LinkClass::exitcave()
  236.  ringcolor(false);
  237.  
  238.   show_subscreen_life=true;
  239.     show_subscreen_numbers=true;
  240.  
  241. int LinkClass::lookahead(int destscr, int d2)                       // Helper for scrollscr that gets next combo on next screen.
  242. {
  243.     // Can use destscr for scrolling warps,
  244.     // but assumes currmap is correct.
  245.    
  246.     int LinkClass::lookaheadflag(int destscr, int d2)
  247.    
  248.     }
  249.  
  250. // Used to find out if an item family is attached to one of the buttons currently pressed.
  251. bool isWpnPressed(int wpn)
  252. {
  253.     if((wpn==getItemFamily(itemsbuf,Bwpn&0xFFF)) && DrunkcBbtn()) return true;
  254.    
  255.     if((wpn==getItemFamily(itemsbuf,Awpn&0xFFF)) && DrunkcAbtn()) return true;
  256.    
  257.     return false;
  258. }
  259.  
  260. // Used for the 'Pickup Hearts' item pickup condition.
  261. bool canget(int id)
  262. {
  263.     return id>=0 && (game->get_maxlife()>=(itemsbuf[id].pickup_hearts*HP_PER_HEART));
  264. }
  265.  
  266. //tf pickup anim
  267.  
  268.  
  269. void LinkClass::getTriforce(int id2)
  270.  
  271.  guys.clear();
  272.     items.clear();
  273.     Ewpns.clear();
  274.     Lwpns.clear();
  275.     Sitems.clear();
  276.     chainlinks.clear();
  277.     decorations.clear();
  278.    
  279.  
  280. void LinkClass::saved_Zelda()
  281. {
  282.     Playing=Paused=false;
  283.     action=won;
  284.     Quit=qWON;
  285.     hclk=0;
  286.     x = 136;
  287.     y = (isdungeon() && currscr<128) ? 75 : 73;
  288.     z = fall = spins = 0;
  289.     dir=left;
  290. }
  291.  
  292. /// QR stuff
  293.  
  294.  
  295. bool no_subscreen()
  296. {
  297.     return (tmpscr->flags3&fNOSUBSCR)!=0;
  298. }
  299.  
  300.      
  301.       if(get_bit(quest_rules,qr_OUCHBOMBS))
  302.          
  303. //global
  304.       sfx(itemsbuf[itemid].usesound);
  305.       stop_sfx(WAV_ER);
  306.      
  307.       stop_sfx() can kill any sound!
  308.       bool no_subscreen();
  309. bool is_zquest();
  310. bool screenIsScrolling();
  311.      
  312.       screen_scale
  313.       byte use_debug_console=0
  314.       currgame=0,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement