| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- //运行参数
- x_spd = 0;
- y_spd = 0;
- x_spd_kb = 0;
- y_spd_kb = 0;
- facing_x = 1;
- facing_y = 1;
- hitstun_timer = 0;
- flash_timer = 0;
- is_dead = false;
- state = undefined;
- hitbox = noone;
- //基础属性
- credit = 0;
- damage = 1;
- hp = 1;
- kb_factor = 1.0;
- hitstun_duration = 10;
- //视觉
- image_speed = 0; //禁用内置参数
- animation_spd = 0.25;
- corpse_sprite = sprite_index; //临时方案,最终被美术素材替代
- flash_duration = 6;
- u_flash_alpha = shader_get_uniform(sh_flash, "f_alpha");
- get_hit_pe = function(_info)
- {
- var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
- repeat(6)
- {
- var _pe = icl(oHitEnemyEffect);
- _pe.dir = random_range(_dir - 45, _dir + 45);
- _pe.x_spd = lengthdir_x(_pe.spd, _pe.dir);
- _pe.y_spd = lengthdir_y(_pe.spd, _pe.dir);
- }
- };
- death_pe = get_hit_pe; //临时方案
- /*
- get_hit_pe_alt = function()
- {
- var _struct = particle_get_info(peBladeHitHazard);
- var _part_type = _struct.emitters[0].parttype.ind;
- var _dir = point_direction(0, 0, _info.kbFactorX, -abs(_info.kbFactorY));
- part_type_direction(_part_type, _dir - 45, _dir + 45, 0, 5);
-
- var _part = part_system_create_layer("Effect", false, peBladeHitHazard);
- part_system_position(_part, x, y);
- };
- */
- //交互逻辑
- corpse_doll = true;
- has_ink = true;
- apply_collision = true;
- invincible = false;
- enemy_ai = function(){};
- death_callback = undefined;
- get_hit = function(_info)
- {
- get_hit_pe(_info);
-
- if has_ink
- player_add_INK(1);
-
- flash_timer = flash_duration;
-
- hitstun_timer = hitstun_duration;
- x_spd_kb = _info.kbFactorX * kb_factor;
- y_spd_kb = _info.kbFactorY * kb_factor;
-
- if !invincible
- hp -= _info.damage;
- if hp <= 0
- {
- is_dead = true;
- enemy_death();
- }
- };
|