其中思路很简单,单线程的一个乱七八糟的游戏

预计会更新背包,背包这个估计会用一个vector来存

图形的话,我得催催我的美工大人,她会帮我弄吧,哇哈哈

界面:

 namespace auttompk
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null; /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} #region Windows 窗体设计器生成的代码 /// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.explabel = new System.Windows.Forms.Label();
this.attacklabel = new System.Windows.Forms.Label();
this.hplabel = new System.Windows.Forms.Label();
this.levellabel = new System.Windows.Forms.Label();
this.fightbox = new System.Windows.Forms.TextBox();
this.splitter1 = new System.Windows.Forms.Splitter();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(, );
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(, );
this.button1.TabIndex = ;
this.button1.Text = "开始";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(, );
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(, );
this.button2.TabIndex = ;
this.button2.Text = "停止";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(, );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(, );
this.label1.TabIndex = ;
this.label1.Text = "生命值";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(, );
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(, );
this.label2.TabIndex = ;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(, );
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(, );
this.label3.TabIndex = ;
this.label3.Text = "攻击力";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(, );
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(, );
this.label6.TabIndex = ;
this.label6.Text = "等级";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(, );
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(, );
this.label4.TabIndex = ;
this.label4.Text = "经验值";
//
// explabel
//
this.explabel.AutoSize = true;
this.explabel.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
this.explabel.Location = new System.Drawing.Point(, );
this.explabel.Name = "explabel";
this.explabel.Size = new System.Drawing.Size(, );
this.explabel.TabIndex = ;
this.explabel.Text = "label5";
//
// attacklabel
//
this.attacklabel.AutoSize = true;
this.attacklabel.Location = new System.Drawing.Point(, );
this.attacklabel.Name = "attacklabel";
this.attacklabel.Size = new System.Drawing.Size(, );
this.attacklabel.TabIndex = ;
this.attacklabel.Text = "label7";
//
// hplabel
//
this.hplabel.AutoSize = true;
this.hplabel.Location = new System.Drawing.Point(, );
this.hplabel.Name = "hplabel";
this.hplabel.Size = new System.Drawing.Size(, );
this.hplabel.TabIndex = ;
this.hplabel.Text = "label8";
//
// levellabel
//
this.levellabel.AutoSize = true;
this.levellabel.Location = new System.Drawing.Point(, );
this.levellabel.Name = "levellabel";
this.levellabel.Size = new System.Drawing.Size(, );
this.levellabel.TabIndex = ;
this.levellabel.Text = "label9";
//
// fightbox
//
this.fightbox.Location = new System.Drawing.Point(, );
this.fightbox.Multiline = true;
this.fightbox.Name = "fightbox";
this.fightbox.Size = new System.Drawing.Size(, );
this.fightbox.TabIndex = ;
//
// splitter1
//
this.splitter1.Location = new System.Drawing.Point(, );
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(, );
this.splitter1.TabIndex = ;
this.splitter1.TabStop = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.splitter1);
this.Controls.Add(this.fightbox);
this.Controls.Add(this.levellabel);
this.Controls.Add(this.hplabel);
this.Controls.Add(this.attacklabel);
this.Controls.Add(this.explabel);
this.Controls.Add(this.label4);
this.Controls.Add(this.label6);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "挂机传奇";
this.ResumeLayout(false);
this.PerformLayout(); } #endregion private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label explabel;
private System.Windows.Forms.Label attacklabel;
private System.Windows.Forms.Label hplabel;
private System.Windows.Forms.Label levellabel;
private System.Windows.Forms.TextBox fightbox;
private System.Windows.Forms.Splitter splitter1;
}
}

新的类:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace auttompk
{
class monster
{
public string name;
public int hp;
public int attack;
public int money;
public int exp;
public int max_hp;
}
}

具体代码:

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; namespace auttompk
{
public partial class Form1 : Form
{
monster shilaimu=new monster(); int level = ;
int max_hp = ;
int now_hp = ;
int attack = ;
int now_exp = ;
int ful_exp = ;
int flag = ; private void start()
{
shilaimu.name="史莱姆";
shilaimu.hp=;
shilaimu.attack=;
shilaimu.money=;
shilaimu.exp=;
shilaimu.max_hp = ;
}
public Form1()
{ InitializeComponent();
start();
show();
} private void show()
{
levellabel.Text = (level).ToString();
hplabel.Text = now_hp.ToString() + "/" + max_hp.ToString();
attacklabel.Text = (attack).ToString();
explabel.Text = now_exp.ToString() + "/" + max_hp.ToString();
} private void find()
{
fightbox.Text += "你遇见了"+shilaimu.name.ToString()+"\r\n";
pk(shilaimu);
} private void pk(monster a)
{
while (true)
{
if (flag == )
{
break;
}
timeDelay();
fightbox.Text += "你对" + a.name.ToString() + "造成了" + attack.ToString() + "伤害\r\n";
a.hp-=attack;
if (a.hp <= )
{
fightbox.Text += "你干死了" + a.name.ToString() + "\r\n";
fightbox.Text += "获得了" + a.money.ToString() + "块钱\r\n";
fightbox.Text += "获得了" + a.exp.ToString() + "经验\r\n\r\n\r\n\r\n";
now_exp += a.exp;
if (now_exp >= ful_exp)
{
now_exp -= ful_exp;
ful_exp *= ;
level += ;
attack *= ;
}
a.hp = a.max_hp;
show();
break;
}
timeDelay();
fightbox.Text += a.name.ToString() + "还剩下" + a.hp.ToString()+"HP\r\n";
if (flag == )
{
break;
}
timeDelay();
if (flag == )
{
break;
}
fightbox.Text += a.name.ToString() + "对你造成了" + attack.ToString() + "伤害\r\n"; now_hp -= a.attack;
if (now_hp <= )
{
fightbox.Text += "你挂了\r\n";
fightbox.Text += "你损失了一半经验值\r\n\r\n\r\n\r\n";
now_exp /= ;
now_hp = max_hp;
a.hp = a.max_hp;
show();
break;
} show();
timeDelay();
}
} private void button1_Click(object sender, EventArgs e)
{ fightbox.Text += "开始挂机\r\n\r\n\r\n\r\n";
flag=;
while (flag == )
{
find();
}
}
private void timeDelay(double secend)
{
DateTime tempTime = DateTime.Now;
while(tempTime.AddSeconds(secend).CompareTo(DateTime.Now) > )
Application.DoEvents(); } private void button2_Click(object sender, EventArgs e)
{
fightbox.Text += "停止挂机\r\n\r\n";
flag = ;
}
}
}

自动打怪 c#的更多相关文章

  1. 使用OpenCv+Arduino实现挂机自动打怪

    使用OpenCv+Arduino实现挂机自动打怪 最近在玩某网游,练级十分枯燥和缓慢,就是挂机刷刷刷,所以研究一下自动化,找了个可以原地挂机刷怪的职业,然后用OpenCv检测技能冷却,冷却好了通过串口 ...

  2. airTest 实战之 -- 【征途】自动打怪回城卖物品

    airTest是一个跨平台的.基于图像识别的UI自动化测试框架,适用于游戏和App,支持平台有Windows.Android和iOS 官方文档: http://airtest.netease.com/ ...

  3. MMORPG大型游戏设计与开发(服务器 游戏场景 搜索机)

    双十一注定是忙碌的日子,所以到了现在我才将今天自己学习的内容拿出来跟大家分享.搜索机是我自己暂时取的名字,其实简单的说就是场景里提供搜索的一个工具,负责场景对象的范围搜索和获取.空洞的理论总是让人一头 ...

  4. 游戏外挂四之利用CE和OD查找被选中怪物和怪物列表

    合肥程序员群:49313181.    合肥实名程序员群:128131462 (不愿透露姓名和信息者勿加入)Q  Q:408365330     E-Mail:egojit@qq.com 这一节我们利 ...

  5. 一个人独立开发 3D 游戏引擎可能吗?

    作者:孙志超链接:https://www.zhihu.com/question/24733255/answer/42000966来源:知乎著作权归作者所有,转载请联系作者获得授权. 当然可以,但难道有 ...

  6. iOS NSURLSession 下载

    周五的时候,有个新的需求,要下载脚本,帮助玩家自动打怪,应该也是挂机的意思吧! 组长让我设计界面,让汤老师设计数据等.我觉得数据的挑战性更大一点,然后就接过来了. 自己还没有形成互联网思维,所以弄了一 ...

  7. vb6源码后台点击任意窗口指定坐标XY位置,支持FLASH和一般的游戏

    vb6源码后台点击任意窗口指定坐标XY位置,支持FLASH和一般的游戏,支持每个网页用不同的IP登陆,支持多线程自动点击 适合自动打怪,游戏练级,配合自动识图功能,自动验证码技术,可以实现更多功能. ...

  8. 用Python制作游戏外挂(上)

    源地址:http://eyehere.net/2012/python-game-bot-autopy-1/ 悲剧成我这样的人,我知道肯定不止我一个,所以我一点都不悲伤:-( 所以我打开了4399小游戏 ...

  9. 不思议迷宫:逆向后的放置play

    前言 前置准备 目标分析 逆向加密逻辑 定位sign与key 解密luac 反编译luajit的bytecode 开启上帝模式 前言     看了fatezero的<阴阳师:一个非酋的逆向旅程& ...

随机推荐

  1. ubuntu下使用qemu模拟ARM(六)------驱动程序【转】

    转自:http://blog.csdn.net/rfidunion/article/details/54709843 驱动程序分为在ubuntu上运行和在ARM开发板上运行两种,我们分别来进行测试 1 ...

  2. 被我误解的max_connect_errors【转】

    实为吾之愚见,望诸君酌之!闻过则喜,与君共勉 第一节  什么是max_connect_errors 一开始接触这个参数的时候,感觉他和max_connections的含义差不多,字面意思简单明了,这个 ...

  3. getattr的使用

    from requests_html import HTMLSession class UrlGenerator(object): def __init__(self, root_url): self ...

  4. 十、springboot之web开发打包生产

    打成war包 打成war包一般可以分两种方式来实现,第一种可以通过eclipse这种开发工具来导出war包,另外一种是使用命令来完成,这里主要介绍后一种 1.修改配置文件 maven:pom文件 &l ...

  5. 洛谷P1266速度限制

    传送门啦 看起来是一个最短路问题,但是引入了速度限制,就要写一下二维最短路了. $ dis[i][j] $ :表示到i这个点,速度为j的最短时间. #include <iostream> ...

  6. MS-SQL2005服务器登录名、角色、数据库用户、角色、架构的关系

    MS SQL2005对2000进行了很大的改进,而用户关系这部分也变得相当复杂了,很多朋友都对此一知半解!下面,我将把我应用中总结的和大家分享下,先从概念入手,希望对不理解的朋友有点提示. 今天我们要 ...

  7. .net程序员写业务代码需要注意的地方

    代码规范要求1.命名空间规范:dao层的impl实现和接口采用一样的命名空间,到对应文件夹层:IxxDaoContext与其实现类采用顶级命名空间. 2.TableEntity文件夹:所有的实体放到各 ...

  8. 浅谈C、C++及其区别、兼容与不兼容

    一.闲说C C语言之所以命名为C,是因为C语言源自Ken Thompson发明的B语言,而 B语言则源自BCPL语言. 1967年,剑桥大学的Martin Richards对CPL语言进行了简化,于是 ...

  9. C语言:九九乘法表打印

    题目: 要求:用“,”分隔算式,用“:”做一行的结尾. 另外1*1=1:这个算式是程序的第一行,前面没有空行. 文字版如下: 输入格式: 无 输出格式: 1*1=1; 2*1=2,2*2=4; 3*1 ...

  10. tp5总结(三)

    1.控制器 1-1.加载页面[使用系统函数eg:http://ww:7070/tp5-2/public/admin/test/load] 1-2.加载页面[继承控制器方法eg:http://ww:70 ...