if (hp <= 0)
{
global.dropped_bat = false
}
global.bat_strength = strength;
/////////////////DEFENSE//////////////
global.bat_defense = defense;
global.current_collision_snow = false;
//////////////////ATTACK/////////////////
global.bat_attack = attack;
//////////////////////DEXTERITY/////////////
//ability to use a projectile
global.bat_dexterity = dexterity;
/////////////////SPEED ///////////
//unaccelerated spaed
global.bat_spd = spd;
///////////////INTELLIGENCE////////////////
//strength of projectiles
global.bat_intelligence = intelligence;
///////////EXPERIEINCE///////////////
//rolling over experience every time kill something with this bat type
global.bat_experience = experience;
///////////////LEVEL///////////////////////////
//experience adds up to a new level for that bat
//this increases stats for that bat type
global.bat_experience_level = experience_level;
global.party_still = LightningBatStill;
global.party_walk = LightningBatWalk;
global.party_kill = LightningBatAttack
if (killed_a_brain == true)
{
sprite_index = LightningBatStill;
killed_a_brain = false;
}
event_inherited();
if (!instance_exists(global.current_collision_lightning))
{
if (flight)
{
sprite_index = LightningBatWalk;
}
else
{
sprite_index = LightningBatStill;
}
}
global.mx1 = 0;
global.my1 = 0;
global.mx2 = 0;
global.my2 = 0;
/*
/// @description draw_lightning_color(path,segment length,width,color1,color2,alpha,fork path,attractive object, enable particles,weighting)
/// @param path
/// @param segment length
/// @param width
/// @param color1
/// @param color2
/// @param alpha
/// @param fork path
/// @param attractive object
/// @param enable particles
/// @param weighting
draw_lightning_hue(path[0],32,32,0,255,.2+.8*(1-abs(weighting)),path[1],p_metal,fx.particles,weighting);
,p_metal,fx.particles,weighting);
*/
if (mouse_check_button_pressed(mb_right))
{
inst = instance_position(mouse_x, mouse_y, BrainParentObject)
inst2 = instance_position(mouse_x,mouse_y, BOSSESParent)
inst3 = instance_position(mouse_x, mouse_y, SpecialBrains)
inst4 = instance_position(mouse_x, mouse_y, FranksParent)
/*
if (SpecialBrains != noone)
{
with (SpecialBrains)
{
if (hp <= 1000)
{
hp_minus = irandom_range(200, 300)
hp -= hp_minus
floater = instance_create_depth(x+10, y-10, -1700, DamageIndicatorObject);
floater.text = string(hp_minus);
if (hp <= 0)
{
instance_create_depth(x, y, -1100,DeadBrainObject);
instance_create_depth(x-150, y-20, -1100, FadingGemObject);
audio_play_sound(DieingBrainSound, 20, false);
instance_destroy()
}
}
}
}*/
if (inst != noone || inst2 != noone || inst3 != noone || inst4 != noone)
{
/*
for (i=0;i<30;i++)
{
show_debug_message("Getting ready to draw lightning")
//draw_set_color(c_white)
//draw_lightning_simple(x,y,mouse_x,mouse_y,32,60)//render lightning with a single line of code!
draw_lightning_color(path[0], 20, 300, c_blue, c_orange, 1.0, path[1], p_metal, fx.particles, weighting);
}*/
global.tgt_x = mouse_x;
global.tgt_y = mouse_y;
for (i=0;i<room_speed/7;i++)
{
instance_create_depth(global.tgt_x, global.tgt_y,-1200,o_lightning_hue)
}
}
}
/*
if (mouse_check_button_pressed(mb_right))
{
show_debug_message("Getting ready to draw lightning")
//draw_set_color(c_white)
//draw_lightning_simple(x,y,mouse_x,mouse_y,32,60)//render lightning with a single line of code!
draw_lightning_hue(path[0],32,32,0,255,.2+.8*(1-abs(weighting)),path[1],p_metal,fx.particles,weighting);
}
*/
Create Super Class.
/*
with(global.current_bat)
{
var obj_index=global.current_bat.object_index;
var obj_name=object_get_name(obj_index); // obj_name="obj_test"
if (obj_name == "LightningBatObject")
{
if (mouse_check_button_pressed(mb_right) && counter == 0)
{
counter++;
global.lightning_1_x = mouse_x;
global.lightning_1_y = mouse_y;
spots = true;
global.lightning_2_x = 0;
global.lightning_2_y = 0;
global.lightning_3_x = 0;
global.lightning_3_y = 0;
}
else if (mouse_check_button_pressed(mb_right) && counter == 1)
{
counter++;
global.lightning_2_x = mouse_x;
global.lightning_2_y = mouse_y;
}
else if (mouse_check_button_pressed(mb_right) && counter == 2)
{
counter++;
global.lightning_3_x = mouse_x;
global.lightning_3_y = mouse_y;
NightObject.visible = true;
global.active = true;
flash = true;
lit_myTimer =0;
alarm_5_flag = false;
}
}
}
//}
if (hp <= 0)
{
instance_destroy();
}
//activate chain lightning
//can choose three enemies
//start by just choosing three points
end_x = x
end_y = y
new_y = y
new_x = x
global.litorigin_x = x;
global.litorigin_y = y;
if global.active
{array = 0;
if (counter == 3)
{
if (lit_myTimer == 0)
{
sprite_index = LightningBatAttack;
new_x = x;
new_y = y;
end_x = global.lightning_1_x;
end_y = global.lightning_1_x;
global.active = true
}
if (lit_myTimer == 1)
{
sprite_index = LightningBlackBack;
new_x = global.lightning_1_x;
new_y = global.lightning_1_y;
end_x = global.lightning_2_x;
end_y = global.lightning_2_y;
}
if (lit_myTimer == 2)
{
sprite_index = LightningBatAttack
new_x = global.lightning_2_x;
new_y = global.lightning_2_y;
end_x = global.lightning_3_x;
end_y = global.lightning_3_y;
}
if (lit_myTimer == 3)
{
counter = 0;
lit_myTimer = 0;
flash = false;
global.active = false;
spots = false;
NightObject.visible = false;
sprite_index = LightningBatStill;
}
}
//end_x = lightning_3_x; //<<< this is my end point - change this to whatever you want
//end_y = lightning_3_y;
//new_x = end_x;
//new_y = end_y;
line_number = 10; //<<<<<<<<number of segments in the line
line_amount = point_distance(x ,y, end_x, end_y) / line_number; // <<<<<<<distance to end point divided by number of segments
for (a = line_number; a > 0; a-=1)
{line_dir = point_direction(new_x, new_y, x ,y);
if a div 2 == (a div 1) / 2
{amount = irandom_range(-25, -55)}
else
{amount = irandom_range(25, 55);}
new_x = new_x + lengthdir_x(line_amount, line_dir + amount);
new_y = new_y + lengthdir_y(line_amount, line_dir + amount);
array[a,0] = new_x;
array[a,1] = new_y;}
//active = false;
}
/*
if (counter == 3)
{
draw_line_width(x,y,lightning_1_x,lightning_1_y,10);
draw_line_width(lightning_1_x,lightning_1_y, lightning_2_x, lightning_2_y,10);
draw_line_width(lightning_2_x,lightning_2_y, lightning_3_x, lightning_3_y,10);
lightning_1_x = 0;
lightning_1_y = 0;
lightning_2_x = 0;
lightning_2_y = 0;
lightning_3_x = 0;
lightning_3_y = 0;
counter = 0;
}
mouse_clear(mb_any);
*/
if (little_lit_flag)
{
instance_create_depth(65, 1245, -1100, MiniLightningObject);
little_lit_flag = false;
}