Mirage Source
err pokemon battle system code. - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: err pokemon battle system code. (/showthread.php?tid=1258)



err pokemon battle system code. - arno321 - 05-09-2007

is this correct
o_definer
Code:
global.identity=0; //SPRITE INDEX OF ENEMY

//
global.battled=1
sound_loop(snd_battle)
room_goto(global);

o_battlecontrol
Code:
CURRENT_ENEMY=1;
CURRENT_SELF=1;
CURRENT_SPRITE=get_sprite(global.enemy[CURRENT_ENEMY]);
CURRENT_SELFSPR=get_sprite(global.our[CURRENT_SELF]);
if variable_global_exists("nointro")==false or variable_global_get("nointro")==false
{
global.killed=0;
global.dead=0;
global.intro=true;
INTROPOS=0;
}
//getting global.turn
global.turn=0;
global.attacking=0;
global.canattack=true;
evisible=true; // if the enemy pokemon is visible
pvisible=true; // if the player pokemon is visible
//^(both used for blinkign when attacking)
blinks=-1;
blinks2=-1;
dead="";
current_y=0;
enemy_y=0;
enemy_h=64;
act="";
//
if variable_global_exists("nointro")
{
if global.nointro=true
{
  global.intro=false;
  global.nointro=false;
  CURRENT_SELF=global.nointro[2];
  CURRENT_ENEMY=global.nointro[3];
  CURRENT_SPRITE=get_sprite(global.enemy[CURRENT_ENEMY]);
  CURRENT_SELFSPR=get_sprite(global.our[CURRENT_SELF]);

}
}

  QRST=string(variable_global_array_get("nointro",4));
  if QRST!="0" and string_length(QRST)>=2
  {
   instance_create(0,0,o_attacker);
    with o_attacker
    {
    attack="Useanitem";
    visible=false;
    //import info about my attack
    my_type=real(get_attack_type(attack));
    my_speed=real(get_attack_speed(attack));
    my_strength=real(get_attack_strength(attack));
    my_accuracy=real(get_attack_accuracy(attack));
    my_attacktype=get_attack_attacktype(attack);
    event_perform(ev_other,ev_user1);
    event_perform(ev_other,ev_user2);
    ///ALL AI ACTIONS ABOVE THIS LINE
    //get who is quicker
    event_perform(ev_other,ev_user3);
    instance_destroy();
    }
   event_perform(ev_other,ev_user0)
  }

o_selector
Code:
width=0;
height=0;
global.imattacking=false;

o_attacker
Code:
pos=1;
current=o_battlecontrol.CURRENT_SELF;
now=4;
repeat 4
{
if global.myattack[current,now]==""
{
number=now-1;
}
now-=1;
}

if variable_local_exists("number")==false
{
number=4;
}
sleep(room_speed);
screen_redraw();
keyboard_clear(ord("Z"));


animation
Code:
instance_destroy();
with(o_battlecontrol)
{
event_perform(ev_other,o_battlecontrol.event);
}
sound_play(snd_attack)

Pokemoncontrol
Code:
T=1;

repeat(global.our_total)
{
spr[T]=get_sprite(global.our[T]);
T+=1;
}

position=1;

Animator
Code:
if sprite_index=0 then visible=false;
if sprite_index!=0{
draw_sprite(sprite_index,image_index,x,y);
}

o_pkmnitemscontrol
Code:
T=1;

repeat(global.our_total)
{
spr[T]=get_sprite(global.our[T]);
T+=1;
}

position=1;

Winbattle
Code:
sound_stop(snd_battle);
sound_loop(snd_battlewin);
alarm[0]=ceil(room_speed+room_speed)
image_alpha=0

o_itemscontrol
Code:
global.nointro=true;
width=0;
height=0;
yplus=0;




dunno if this is correct its from a friend who gave it to me


Re: err pokemon battle system code. - Rezeyu - 05-09-2007

Correct for.. what?

Is that C#?


Re: err pokemon battle system code. - arno321 - 06-09-2007

my friend says its with C# or VB he doesnt know lol he just said he found it on website :roll:


Re: err pokemon battle system code. - JohnY - 06-09-2007

It's not VB6.


Re: err pokemon battle system code. - Dragoons Master - 07-09-2007

It's not VB nor C/C++/C#...


Re: err pokemon battle system code. - Rezeyu - 07-09-2007

But it uses {}, I thought mostly C languages use those. Does Python use them?


Re: err pokemon battle system code. - Dragoons Master - 07-09-2007

It looks a lot like C/C++ but look at this:
Code:
if variable_global_exists("nointro")==false or variable_global_get("nointro")==false
{
C/C++ does not use or, it uses ||and the if need to be if().
It looks like someone tried to code C/C++ but wasn't that successful...


Re: err pokemon battle system code. - Rezeyu - 07-09-2007

C# uses If-Then


Re: err pokemon battle system code. - Dragoons Master - 07-09-2007

Hummm, MSC# does not use if-then...


Re: err pokemon battle system code. - Rezeyu - 07-09-2007

http://www.softsteel.co.uk/tutorials/cS ... son10.html

Has it as a command. =/
C# reminds me alot of VB.. since it has like Thing.Thing2 etc.


Re: err pokemon battle system code. - Dragoons Master - 07-09-2007

C# ~= C++ ~= C
That's what I think xD They are all almost the same. They all have the same syntax, but C# has a lot of reserved names that C++ does not have and C++ has a lot of reserver names that C does not have.