示例#1
0
        public override void Update_Monster(Player pl, Floor fl)
        {
            heal_near_altar(fl);

            detect_player(pl, fl);

            has_moved = false;
            if (!stunned)
            {
                if (can_see_player)
                {
                    last_seen_player_loc = pl.get_my_grid_C();

                    if (sequence_cooldown == 0)
                    {
                        if (!bite_available && !volley_available)
                        {
                            bite_available = true;
                            volley_available = true;
                            bite_stage = 0;
                            volley_stage = 0;
                        }

                        if (bite_available && volley_available)
                        {
                            if (rGen.Next(2) == 0)
                            {
                                current_sequence = attack_sequence.Biting;
                                bite_available = false;
                            }
                            else
                            {
                                current_sequence = attack_sequence.Volley;
                                volley_available = false;
                            }
                            sequence_cooldown = 4;
                        }
                        else
                        {
                            if (!bite_available)
                            {
                                current_sequence = attack_sequence.Volley;
                                volley_available = false;
                            }
                            else
                            {
                                current_sequence = attack_sequence.Biting;
                                bite_available = false;
                            }
                            sequence_cooldown = 4;
                        }
                    }

                    switch (current_sequence)
                    {
                        case attack_sequence.None:
                            if(is_player_within(pl, 1))
                            {
                                fl.addmsg("The Boneyard slashes at you!");
                                Attack dmg = dealDamage();
                                fl.add_effect(dmg_type, pl.get_my_grid_C());
                                pl.take_damage(dmg, fl, "");
                                sequence_cooldown--;
                            }
                            else
                            {
                                advance_towards_single_point(pl.get_my_grid_C(), pl, fl, 1, corporeal);
                                if (!has_moved)
                                    fire_singletarget_bonespear(fl, pl.get_my_grid_C());
                                else
                                    sequence_cooldown--;
                            }
                            break;
                        case attack_sequence.Biting:
                            switch (bite_stage)
                            {
                                case 0:
                                    my_Texture = bitey_texture;
                                    fl.add_new_popup("Roars!", Popup.popup_msg_type.Alert, my_center_coordinate(), false, false);
                                    bloodspray(fl, pl);
                                    bite_stage++;
                                    break;
                                case 1:
                                    bite_alert(fl);
                                    bite_stage++;
                                    break;
                                case 2:
                                    //Bite goes off
                                    execute_bite(fl, pl);
                                    bite_stage = 0;
                                    my_Texture = normal_texture;
                                    current_sequence = attack_sequence.None;
                                    break;
                            }
                            break;
                        case attack_sequence.Volley:
                            switch (volley_stage)
                            {
                                case 0:
                                    //target player
                                    target_bonespear(fl, pl.get_my_grid_C(), true);
                                    fl.add_specific_effect(Floor.specific_effect.Warning_Bracket, pl.get_my_grid_C());
                                    volley_stage++;
                                    break;
                                case 1:
                                    //shoot spear
                                    fire_bonespear(fl, true);
                                    //target player
                                    target_bonespear(fl, pl.get_my_grid_C(), true);
                                    volley_stage++;
                                    break;
                                case 2:
                                    //shoot spear
                                    fire_bonespear(fl, true);
                                    //target player
                                    target_bonespear(fl, pl.get_my_grid_C(), true);
                                    volley_stage++;
                                    break;
                                case 3:
                                    //shoot spear
                                    fire_bonespear(fl, true);
                                    volley_stage = 0;
                                    current_sequence = attack_sequence.None;
                                    break;
                            }
                            break;
                    }
                }
                else if (!can_see_player && have_i_seen_player)
                {
                    advance_towards_single_point(last_seen_player_loc, pl, fl, 0, corporeal);
                    if (occupies_tile(last_seen_player_loc))
                    {
                        last_seen_player_loc = my_grid_coords[0];
                        have_i_seen_player = false;
                    }
                }
                else if (!can_see_player && !have_i_seen_player && heard_something)
                {
                    //If the boneyard has LOS to the sound's origin, fire bone spears at it repeatedly - the AOE kind.
                    //Otherwise, simply move to the sound.
                    if(last_path_to_sound.Count > 0 && can_i_see_point(fl, last_path_to_sound[0]))
                    {
                        switch(blind_volley_stage)
                        {
                            case 0:
                                break;
                            case 1:
                                break;
                        }
                    }
                    else
                    {
                        follow_path_to_sound(fl, pl);
                    }
                }
            }

            base.Update_Monster(pl, fl);
        }
示例#2
0
        public override void Update_Monster(Player pl, Floor fl)
        {
            heal_near_altar(fl);

            if (is_player_within(pl, sight_range))
            {
                can_see_player = can_i_see_point(fl, pl.get_my_grid_C());
            }
            else
            {
                can_see_player = false;
            }

            has_moved = false;
            if (!stunned)
            {
                if (can_see_player)
                {
                    if (sequence_cooldown == 0)
                    {
                        if (!bite_available && !volley_available)
                        {
                            bite_available   = true;
                            volley_available = true;
                            bite_stage       = 0;
                            volley_stage     = 0;
                        }

                        if (bite_available && volley_available)
                        {
                            if (rGen.Next(2) == 0)
                            {
                                current_sequence = attack_sequence.Biting;
                                bite_available   = false;
                            }
                            else
                            {
                                current_sequence = attack_sequence.Volley;
                                volley_available = false;
                            }
                            sequence_cooldown = 4;
                        }
                        else
                        {
                            if (!bite_available)
                            {
                                current_sequence = attack_sequence.Volley;
                                volley_available = false;
                            }
                            else
                            {
                                current_sequence = attack_sequence.Biting;
                                bite_available   = false;
                            }
                            sequence_cooldown = 4;
                        }
                    }

                    switch (current_sequence)
                    {
                    case attack_sequence.None:
                        if (is_player_within(pl, 1))
                        {
                            fl.addmsg("The Boneyard slashes at you!");
                            Attack dmg = dealDamage();
                            fl.add_effect(dmg_type, pl.get_my_grid_C());
                            pl.take_damage(dmg, fl, "");
                            sequence_cooldown--;
                        }
                        else
                        {
                            advance_towards_single_point(pl.get_my_grid_C(), pl, fl, 1, corporeal);
                            if (!has_moved)
                            {
                                fire_singletarget_bonespear(fl, pl.get_my_grid_C());
                            }
                            else
                            {
                                sequence_cooldown--;
                            }
                        }
                        break;

                    case attack_sequence.Biting:
                        switch (bite_stage)
                        {
                        case 0:
                            my_Texture = bitey_texture;
                            fl.add_new_popup("Roars!", Popup.popup_msg_color.Red, my_center_coordinate());
                            bloodspray(fl, pl);
                            bite_stage++;
                            break;

                        case 1:
                            bite_alert(fl);
                            bite_stage++;
                            break;

                        case 2:
                            //Bite goes off
                            execute_bite(fl, pl);
                            bite_stage       = 0;
                            my_Texture       = normal_texture;
                            current_sequence = attack_sequence.None;
                            break;
                        }
                        break;

                    case attack_sequence.Volley:
                        switch (volley_stage)
                        {
                        case 0:
                            //target player
                            target_bonespear(fl, pl);
                            fl.add_specific_effect(Floor.specific_effect.Warning_Bracket, pl.get_my_grid_C());
                            volley_stage++;
                            break;

                        case 1:
                            //shoot spear
                            fire_bonespear(fl);
                            //target player
                            target_bonespear(fl, pl);
                            volley_stage++;
                            break;

                        case 2:
                            //shoot spear
                            fire_bonespear(fl);
                            //target player
                            target_bonespear(fl, pl);
                            volley_stage++;
                            break;

                        case 3:
                            //shoot spear
                            fire_bonespear(fl);
                            volley_stage     = 0;
                            current_sequence = attack_sequence.None;
                            break;
                        }
                        break;
                    }
                }
                else if (!can_see_player && have_i_seen_player)
                {
                    advance_towards_single_point(last_seen_player_loc, pl, fl, 0, corporeal);
                    if (occupies_tile(last_seen_player_loc))
                    {
                        last_seen_player_loc = my_grid_coords[0];
                        have_i_seen_player   = false;
                    }
                }
                else if (!can_see_player && !have_i_seen_player && heard_something)
                {
                    follow_path_to_sound(fl, pl);
                }
            }

            base.Update_Monster(pl, fl);
        }
示例#3
0
        public Boneyard(gridCoordinate sGridCoord, ContentManager sCont, Texture2D b_texture, int sIndex, bool bossmonster)
            : base(sGridCoord, sCont, b_texture, sIndex, Monster_Size.Large)
        {
            monster_typ = Monster_Type.Boneyard;
            normal_texture = sCont.Load<Texture2D>("Enemies/boneyard");
            bitey_texture = sCont.Load<Texture2D>("Enemies/boneyard_biting");
            my_Texture = normal_texture;

            if (bossmonster)
            {
                max_hitPoints = 250;
                boss_monster = true;

                min_damage = 6;
                max_damage = 18;
                bone_spear_mindmg = 12;
                bone_spear_maxdmg = 18;
                bite_min_damage = 16;
                bite_max_damage = 24;
                blood_spray_mindmg = 6;
                blood_spray_maxdmg = 6;
            }
            else
            {
                max_hitPoints = 60;

                min_damage = 12;
                max_damage = 24;
                bone_spear_mindmg = 12;
                bone_spear_maxdmg = 20;
                bite_min_damage = 20;
                bite_max_damage = 30;
                blood_spray_mindmg = 6;
                blood_spray_maxdmg = 10;
            }
            hitPoints = max_hitPoints;

            //SENSORY
            base_sight_range = 6;
            can_hear = true;
            sounds_i_can_hear.Add(SoundPulse.Sound_Types.Player);
            sounds_i_can_hear.Add(SoundPulse.Sound_Types.Voidwraith_Scream);
            base_listen_threshold.Add(4);
            base_listen_threshold.Add(1);

            set_senses_to_baseline();

            my_name = "Boneyard";
            melee_dodge = 5;
            ranged_dodge = 5;
            set_initial_dodge_values();

            //Other values
            bite_available = true;
            volley_available = true;
            volley_stage = 0;
            bite_stage = 0;
            blind_volley_stage = 0;
            sequence_cooldown = 6;

            have_i_seen_player = false;
            last_seen_player_loc = my_grid_coords[0];
            current_sequence = attack_sequence.None;
        }
示例#4
0
        public Boneyard(gridCoordinate sGridCoord, ContentManager sCont, int sIndex, bool bossmonster)
            : base(sGridCoord, sCont, sIndex, Monster_Size.Large)
        {
            normal_texture = sCont.Load <Texture2D>("Enemies/boneyard");
            bitey_texture  = sCont.Load <Texture2D>("Enemies/boneyard_biting");
            my_Texture     = normal_texture;

            if (bossmonster)
            {
                max_hitPoints = 250;
                boss_monster  = true;

                min_damage         = 1;
                max_damage         = 3;
                bone_spear_mindmg  = 2;
                bone_spear_maxdmg  = 3;
                bite_min_damage    = 4;
                bite_max_damage    = 6;
                blood_spray_mindmg = 1;
                blood_spray_maxdmg = 1;
            }
            else
            {
                max_hitPoints = 60;

                min_damage         = 2;
                max_damage         = 5;
                bone_spear_mindmg  = 3;
                bone_spear_maxdmg  = 4;
                bite_min_damage    = 5;
                bite_max_damage    = 7;
                blood_spray_mindmg = 1;
                blood_spray_maxdmg = 2;
            }
            hitPoints = max_hitPoints;

            //SENSORY
            base_sight_range = 6;
            can_hear         = true;
            sounds_i_can_hear.Add(SoundPulse.Sound_Types.Player);
            sounds_i_can_hear.Add(SoundPulse.Sound_Types.Voidwraith_Scream);
            base_listen_threshold.Add(4);
            base_listen_threshold.Add(1);

            set_senses_to_baseline();

            my_name      = "Boneyard";
            melee_dodge  = 5;
            ranged_dodge = 5;
            set_initial_dodge_values();

            //Other values
            bite_available    = true;
            volley_available  = true;
            volley_stage      = 0;
            bite_stage        = 0;
            sequence_cooldown = 6;

            have_i_seen_player   = false;
            last_seen_player_loc = my_grid_coords[0];
            current_sequence     = attack_sequence.None;
        }