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

预计会更新背包,背包这个估计会用一个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. shutdown系统调用

    /* * Shutdown a socket. */ SYSCALL_DEFINE2(shutdown, int, fd, int, how) { int err, fput_needed; stru ...

  2. Linux Kernel sys_call_table、Kernel Symbols Export Table Generation Principle、Difference Between System Calls Entrance In 32bit、64bit Linux【转】

    转自:http://www.cnblogs.com/LittleHann/p/4127096.html 目录 1. sys_call_table:系统调用表 2. 内核符号导出表:Kernel-Sym ...

  3. 2018Java开发面经(持续更新)

    不要给自己挖坑!!!不要给自己挖坑!!!不要给自己挖坑!!!如果面试官只是问你了解xxx吗,如果不是很了解,就直接说不知道,不要说知道,不然面试官深问再不知道就印象很不好! 处女面送给了头条(北京)日 ...

  4. js中字符串的常用方法

    一.普通方法 1.字符方法 动态方法:1.str.charAt(index);  返回子字符串,index为字符串下标,index取值范围[0,str.length-1] 动态方法:2.str.cha ...

  5. 洛谷P1286 两数之和

    这个题.. 刚开始没看见输入若干行,所以有的点就.. 令 m = n * (n - 1) / 2 已知 s = {s (1), s(2), ..., s(m)}, s(i) <= s(i+1) ...

  6. 日志、字段备注查询、自增ID联系设置、常用存储过程

    -----获取数据字典SQL(表字段说明)SELECT     [Table Name] = OBJECT_NAME(c.object_id),     [Column Name] = c.name, ...

  7. Effective STL 学习笔记 Item 38 : Design functor classes for pass-by-value

    Effective STL 学习笔记 Item 38 : Design functor classes for pass-by-value */--> div.org-src-container ...

  8. 《精通Python设计模式》学习之建造者模式

    这种模式,就是将一个最终对象分级分层建造出来. 在软件发布过程中,不同的JAVA,PYTHON,NODE.JS,ZIP压缩包, 就可以使用不同的阶段来使用建造者模式的. from enum impor ...

  9. 【AtCoder】AGC011 D - Half Reflector

    题解 大意是n个管子排成一排,每个管子有两种状态,A状态是从某个方向进去,从原方向出来,B状态是从某个方向进去,从另一个方向出来 球经过一个A状态的管子这个管子会立刻变成B状态,经过一个B状态的管子会 ...

  10. 【POJ】1704.Georgia and Bob

    题解 感觉挺神奇的 我们把石子从后往前相邻的两个两两配对,这样他们之间的空格就相当于一堆石子 而配对后左边棋子移动,右边棋子也一定可以跟上取 转化成简单的nim游戏,最后只要看转化出的这(N - 1) ...