User Tag List

Results 1 to 10 of 17

Thread: [Request] Custom potions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,307
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.25%

    Re: [Request] Custom potions

    Code:
    item script CustomPotion{
    	void run(int refil,int counter){
    		if(counter == 0){
    			Link->MP += refil;
    			if(Link->MP > Link->MaxMP) Link->MP = Link->MaxMP;
    		}else{
    			Link->HP += refil;
    			if(Link->HP > Link->MaxHP) Link->HP = Link->MaxHP;
    		}
    	}
    }
    D1: Amount to refil
    D2: 1 to refil hearts, 0 to refil magic

    To take the item away after useage, there's a little checkbox somewhere in the item editor.

  2. #2
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,962
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.57%

    Re: [Request] Custom potions

    No, it's actually quite easy to do.


    Code:
    void Refill(){
    	int hp = Link->MaxHP-Link->HP;
    	for(int i;i<mp;i++){
    		Link->HP++;
    		Game->PlaySound(SFX_REFILL);
    		Waitframe();
    	}
    }
    
    void RefillMagic(){
    	int mp = Link->MaxMP-Link->MP;
    	for(int i;i<hp;i++){
    		Link->MP++;
    		if(Link->MP < Link->MaxMP){
    			Link->MP++;i++;
    		}
    		Game->PlaySound(SFX_REFILL);
    		Waitframe();
    	}
    }
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,307
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.25%

    Re: [Request] Custom potions

    Oops. Nevermind.

    Quote Originally Posted by Gleeok View Post
    No, it's actually quite easy to do.
    If you want to A: add a section to the global script and B: stop all other functions in the global script for 128 frames or something then yeah sure...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social