当前位置: 首页>>代码示例>>C#>>正文


C# Floor.addmsg方法代码示例

本文整理汇总了C#中Floor.addmsg方法的典型用法代码示例。如果您正苦于以下问题:C# Floor.addmsg方法的具体用法?C# Floor.addmsg怎么用?C# Floor.addmsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Floor的用法示例。


在下文中一共展示了Floor.addmsg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: fire_singletarget_bonespear

 public void fire_singletarget_bonespear(Floor fl, gridCoordinate target_GC)
 {
     fl.addmsg("The Boneyard spits a bone spear at you!");
     Projectile bs = new Projectile(randomly_chosen_personal_coord(), target_GC,
                                    Projectile.projectile_type.Bonespear, ref cont, true,
                                    Scroll.Atk_Area_Type.singleTile);
     bs.set_damage_range(bone_spear_mindmg, bone_spear_maxdmg);
     bs.set_damage_type(bone_spear_dmgtyp);
     fl.create_new_projectile(bs);
 }
开发者ID:Chupaflor,项目名称:Cronkpit_Samples,代码行数:10,代码来源:Boneyard.cs

示例2: Update_Monster

        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
//.........这里部分代码省略.........
开发者ID:Chupaflor,项目名称:Cronkpit_Samples,代码行数:101,代码来源:Boneyard.cs

示例3: execute_bite

        public void execute_bite(Floor fl, Player pl)
        {
            int pl_x_dir = 0;
            int pl_y_dir = 0;

            gridCoordinate top_left = my_grid_coords[0];
            gridCoordinate bottom_right = my_grid_coords[3];

            int pl_x_c = pl.get_my_grid_C().x;
            int pl_y_c = pl.get_my_grid_C().y;

            //Determine X direction
            if (pl_x_c > top_left.x && pl_x_c > bottom_right.x)
                pl_x_dir = 1;
            else if (pl_x_c < top_left.x && pl_x_c < bottom_right.x)
                pl_x_dir = -1;

            //Determine Y direction
            if (pl_y_c > top_left.y && pl_y_c > bottom_right.y)
                pl_y_dir = 1;
            else if (pl_y_c < top_left.y && pl_y_c < bottom_right.y)
                pl_y_dir = -1;

            int target_index = -1;
            for (int i = 0; i < movement_indexes.Count; i++)
            {
                if (movement_indexes[i][0] == pl_x_dir && movement_indexes[i][1] == pl_y_dir)
                    target_index = i;
            }

            List<gridCoordinate> biting_coords = new List<gridCoordinate>();
            for (int i = 0; i < my_grid_coords.Count; i++)
                biting_coords.Add(new gridCoordinate(my_grid_coords[i].x + (pl_x_dir*2),
                                                     my_grid_coords[i].y + (pl_y_dir*2)));

            fl.add_specific_effect(Floor.specific_effect.Big_Bite, biting_coords[0]);
            for(int i = 0; i < my_grid_coords.Count; i++)
                if (biting_coords[i].x == pl.get_my_grid_C().x && biting_coords[i].y == pl.get_my_grid_C().y)
                {
                    List<string> bparts = new List<string>();
                    if (rGen.Next(2) == 0)
                    {
                        bparts.Add("RLeg");
                        bparts.Add("RArm");
                    }
                    else
                    {
                        bparts.Add("LArm");
                        bparts.Add("LLeg");
                    }

                    fl.addmsg("The boneyard's jaws snap shut, and your bones snap with it!");
                    pl.take_damage(new Attack(Attack.Damage.Crushing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[0]);
                    pl.take_damage(new Attack(Attack.Damage.Slashing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[0]);
                    pl.take_damage(new Attack(Attack.Damage.Crushing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[1]);
                    pl.take_damage(new Attack(Attack.Damage.Slashing, rGen.Next(bite_min_damage, bite_max_damage + 1), break_armor: true), fl, bparts[1]);
                    fl.addmsg("You start bleeding profusely from the attack!");
                    pl.add_single_statusEffect(new StatusEffect(Scroll.Status_Type.Hemorrhage, 5, true, 0, 0, false));
                }
        }
开发者ID:Chupaflor,项目名称:Cronkpit_Samples,代码行数:60,代码来源:Boneyard.cs


注:本文中的Floor.addmsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。