我被要求创建一个模拟器游戏 [英] i am asked to create a simulator game where by the

查看:68
本文介绍了我被要求创建一个模拟器游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

游戏由五个单元组成。四个友方单位(战士,盗贼,弓箭手和法师)

和一个敌方单位(Ogre)。每个单元必须能够显示(),Attack()和Defend()。你必须确保攻击行为和防御行为是动态设置的,并且它们可以互换。\\ b
它们是可以互换的。关于单位的以下指南将在

实例化时间内使用:

•食人魔:ClubAttack,NoDefend

•战士:SwordAttack, ShieldDefend

•盗贼:DaggerAttack,ShieldDefend

•Archer:ArrowAttack,NoDefend

•Mage:调整给定代码(下一页)上班项目:



公共级法师

{

公共物品火球()

{

返回CAST A FIREBALL

}

公共物品orb

{

返回Cast orb protection

}

}





设备

单位应具有动态装饰设备的功能,并允许无限制添加。
允许无限制添加。对于这个模拟,战士应该获得三个Golden

Rings和Mage一个Topaz Amulet。只要点击从战士中删除戒指按钮,直到战士没有更多戒指装备,就可以从

战士中取出一个金戒指。

注意:如果没有留下戒指,则显示一个MessageBox。

升级

单位应该具有动态装饰的功能,同时升级他们的基础武器级别和基础装甲级别。每次装甲升级使用+10,每次武器升级使用+1 / b $ b。升级应无限制。你不需要升级法师的

基础护甲或基础武器等级。

Bonus Marks:包括升级Ogre的护甲类和武器的功能

class。



武器信息

武器文本框必须显示每个单位的伤害信息。考虑到基础伤害和所有武器升级,此值必须累积为b


•食人魔基础伤害为20

•战士基础伤害为10

•弓箭手基础伤害为9

•盗贼基础伤害为8

•法师基础伤害为15



注意:应该为每个单位的行为攻击显示伤害值

如图1所示。

红利标记。为单位提供用武器装饰的功能,并让单位

使用该武器进行攻击。例如用Excalibur装饰战士

导致以下输出:战士:用Excalibur攻击。 [21]。

护甲消息:

护甲文本框必须显示每个单位的护甲信息。考虑到基础护甲等级和所有装甲升级,此值必须为累积值。

•食人魔基础护甲值为0

•战士基础护甲值为0

•弓箭手护甲值为0

•流氓基础护甲为0

•法师基础护甲为0

注意:护甲值应显示在每个单位的行为防御上,如
$ b $所示b



生命值

每个单位必须有生命值,将根据造成的伤害进行调整
$ b $它是由食人魔。开始生命值;

•食人魔以1000点生命值开始

•战士以250点生命值开始

•弓箭手以100点生命值开始

•盗贼以100个生命值开始

•法师以100个生命值开始





战斗

战斗可以分为三个部分:聚会,与食人魔和食人魔作战的单位

打击单位。



派对

四个友方单位必须属于参与战斗的一方。确保在模拟开始时将

分配给参与方。当一个党员逃亡或死亡时,

单位不再是该党的成员,将脱离战斗。然后你可以将
从派对列表中删除。确保您更新Party Members文本框(见下文)

以反映对该方的任何更改。括号[]也表示每个

单位的当前生命值。



食人魔打击单位

当点击食人魔交易伤害按钮时,食人魔会攻击所有党员
(在党员中列出)。食人魔必须能够动态地将他的武器改为

俱乐部或剑。此外,食人魔的攻击必须根据该单位的

护甲升级进行修改。使用以下公式:

formula = ogreDamage - (unit.Armor()/ 10);

每次点击Ogre

Deal Damage时更新(反馈回合x)和(党员)文本框。提供了一个例子。食人魔的攻击应列在

(反馈回合x)下,成员及其各自的生命值在[]下方(派对

成员)。



派对打击食人魔

当点击战斗按钮时,派对中的单位将攻击食人魔并造成

物理伤害。每个单位的攻击必须考虑所有武器升级



每次点击战斗时更新(反馈回合x)文本框。一个例子是

提供。

领袖

利用委托将战士单位指定为小组的领导者。每次你点击战斗
时,他必须显示消息充电!。如果战士死亡或逃亡,

将战士注销为代表,并在屏幕上指示该党是无领导的。

排序

请注意:您必须按字母顺序对模拟界面上的所有文本框进行排序。

解决方案

好的,因为你根本没有提出任何问题,所以几乎不可能告诉你任何有用的东西。



嗯,除了Permission Granted之外,请继续你的开发工作!

The game is made up of five units. Four friendly units (Warrior, Rogue, Archer and Mage)
and one enemy unit (Ogre). Each unit must be able to Display(), Attack() and Defend(). You
must ensure that the attack behavior and a defend behavior are set dynamically and that
they are interchangeable. The following guidelines on the units are given to be used at
instantiation time:
• Ogre: ClubAttack, NoDefend
• Warrior: SwordAttack, ShieldDefend
• Rogue: DaggerAttack, ShieldDefend
• Archer: ArrowAttack, NoDefend
• Mage: Adapt the given code (next page) to work with project:

public class Mage
{
public object fireball()
{
return"CAST A FIREBALL"
}
public object orb
{
return "Cast orb protection"
}
}


Equipment
The units should have the functionality to be dynamically decorated with equipment and
allow for unlimited additions. For this simulation the Warrior should get three "Golden
Rings" and the Mage one "Topaz Amulet". Have a single "Golden Ring" removed from the
Warrior whenever the "Remove Ring from Warrior" button is clicked until the Warrior has no
more rings outfitted.
Note: Display a MessageBox if there is no ring left to beremoved.
Upgrades
The units should have the functionality to be dynamically decorated with upgrades to both
their base weapon class and base armor class. Use +10 for each armor upgrade and +1 for
each weapon upgrade. The upgrades should be unlimited. You do not need to upgrade the
base armor or base weapon class of the Mage.
Bonus Marks: Include the functionality to upgrade the Ogre’s armor class and weapon
class.

Weapons Messages
The Weapons textbox must display the damage information for each unit. This value must
be accumulative taking into account the base damageand all weapon upgrades.
• Ogre base damage is 20
• Warrior base damage is 10
• Archer base damage is 9
• Rogue base damage is 8
• Mage base damage is 15

NOTE: The damage value should be displayed for each unit’s behavioural attack as
indicated on Figure 1.
Bonus marks. Give units the functionality to be decorated with aweapon and allow the units
to use that weapon for the attack. For example decorate the "Warrior" with "Excalibur"
resulting in the following output: Warrior : Attack with Excalibur. [21].
Armor Messages:
The Armor textbox must display the armor information for each unit. This value must be
accumulative taking into account the base armor class and all armor upgrades.
• Ogre base armor is 0
• Warrior base armor is 0
• Archer base armor is 0
• Rogue base armor is 0
• Mage base armor is 0
NOTE: The armor value should be displayed each unit’s behavioral defense as indicated on


Hit points
Each unit must have hit points which will be adjusted according to the damage inflicted upon
it by the Ogre. Starting hit points;
• Ogre starts with 1000 hit points
• Warrior starts with 250 hit points
• Archers starts with 100 hit points
• Rogues starts with 100 hit points
• Mages starts with 100 hit points


Combat
Combat can be divided into three section: the party, units combatting with the ogre and ogre
combatting the units.

The Party
The four friendly units must belong to the party tobe able to engage in combat. Ensure they
are assigned to the party when the simulation starts. When a party member flees or dies, the
unit is no longer a member of the party and will disengage from combat. You can then
remove it from the party list. Make sure you updatethe Party Members textbox (see below)
to reflect any changes to the party. Also in brackets [] indicate the current hit points of each
unit.

Ogre Combatting the Units
When the "Ogre Deal Damage" button is clicked, the Ogre will attack all the party members
(listed in Party Members). The Ogre must be able to dynamically change his weapon to
either a Club or Sword. Also, the attacks of the Ogre must be modified according to the unit’s
armor upgrades. Use the following formula:
formula = ogreDamage - (unit.Armor() / 10);
Update the (Feedback Round x) and (Party Member) textboxes each time you click "Ogre
Deal Damage". An example is provided. The attacks of the Ogre should be listed under
(Feedback Round x) and the members and their respective hit points in [] under (Party
Members).

Party Combating the Ogre
When the "Combat" button is clicked, the units in the party will attack the Ogre and inflict
physical damage to it. The attacks of each unit must take into account all weapon upgrades
made to it.
Update the (Feedback Round x) textbox for each timeyou click "Combat". An example is
provided.
Leader
Make use of a delegateto assign the warrior unit as the leader of the group. Each time you
click on "Combat" he must display the message "Charge!". If the warrior dies, or flees,
deregister the warrior as a delegate and indicate on the screen the party is leaderless.
Sorting
Please Note: You must sort all the textboxes on the simulationinterface alphabetically.

解决方案

OK, since you didn't ask a question at all, it's pretty much impossible to tell you anything useful.

Well, other than "Permission Granted, please proceed with your development work!"


这篇关于我被要求创建一个模拟器游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆