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

预计会更新背包,背包这个估计会用一个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. SQL语句帮助大全

    --删除约束 Status:字段名 alter table Table_1 drop constraint Status; --添加约束 --Status :字段名 t_Pay_Order:表名 默认 ...

  2. Prepare tasks for django project deployment.md

    As we know, there are some boring tasks while deploy Django project, like create db, do migrations a ...

  3. python时序数据分析--以示例说明

    Python时间序列数据分析--以示例说明 标签(空格分隔): 时间序列数据分析 本文的内容主要来源于博客:本人做了适当的注释和补充. https://www.analyticsvidhya.com/ ...

  4. 深入理解HashMap(及hash函数的真正巧妙之处)

    原文地址:http://www.iteye.com/topic/539465 Hashmap是一种非常常用的.应用广泛的数据类型,最近研究到相关的内容,就正好复习一下.网上关于hashmap的文章很多 ...

  5. ioctl()函数获取本机IP、MAC

    #include <sys/ioctl.h> int ioctl(int d, int request, ...); /* Socket configuration controls. * ...

  6. 牛客红包OI赛 C 小可爱表白

    据说是个公式题. Code #include<cstdio> #include<cstring> #include<algorithm> using namespa ...

  7. 洛谷P3378堆

    传送门啦 #include <iostream> #include <cstdio> #include <cstring> #include <algorit ...

  8. 洛谷P1938 找工就业

    传送门啦 这个题本质就是跑一边最长路,重点就是在怎么建图上. 我们可以把点权放到边权上面,即将每一个边的终点点权当做这个边的边权,这个题里就是将工钱 $ d $ 当做边权. 如果这一条边需要坐飞机才能 ...

  9. 16/11/22_plsql

    1.数据类型: char 固定长度,varchar 字符长度按照实际长度, varchar2 字符均存储2个字节, nvarchar 按照Unicode存储.number(m,n)总长度m,小数 n. ...

  10. HDU 1507 Uncle Tom's Inherited Land(最大匹配+分奇偶部分)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1507 题目大意:给你一张n*m大小的图,可以将白色正方形凑成1*2的长方形,问你最多可以凑出几块,并输 ...