first commit
This commit is contained in:
16
Fall 2017/SE 1011/Battle Simulator 3000/.idea/checkstyle-idea.xml
generated
Normal file
16
Fall 2017/SE 1011/Battle Simulator 3000/.idea/checkstyle-idea.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CheckStyle-IDEA">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="checkstyle-version" value="8.5" />
|
||||
<entry key="copy-libs" value="true" />
|
||||
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
|
||||
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="scan-before-checkin" value="false" />
|
||||
<entry key="scanscope" value="JavaOnly" />
|
||||
<entry key="suppress-errors" value="false" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
Fall 2017/SE 1011/Battle Simulator 3000/.idea/misc.xml
generated
Normal file
6
Fall 2017/SE 1011/Battle Simulator 3000/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
8
Fall 2017/SE 1011/Battle Simulator 3000/.idea/modules.xml
generated
Normal file
8
Fall 2017/SE 1011/Battle Simulator 3000/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/Battle Simulator 3000.iml" filepath="$PROJECT_DIR$/Battle Simulator 3000.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
628
Fall 2017/SE 1011/Battle Simulator 3000/.idea/workspace.xml
generated
Normal file
628
Fall 2017/SE 1011/Battle Simulator 3000/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,628 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="25280807-8910-45ca-9812-831d60f194d1" name="Default" comment="" />
|
||||
<ignored path="$PROJECT_DIR$/out/" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CheckStyle-IDEA-workspace">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="last-active-plugin-version" value="5.18.4" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
|
||||
<file leaf-file-name="Die.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="289">
|
||||
<caret line="23" column="1" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Lab07.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Lab07.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1802">
|
||||
<caret line="106" column="71" lean-forward="false" selection-start-line="106" selection-start-column="71" selection-end-line="106" selection-end-column="71" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Warrior.java" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Warrior.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-198">
|
||||
<caret line="14" column="24" lean-forward="false" selection-start-line="14" selection-start-column="24" selection-end-line="14" selection-end-column="24" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Mugwump.java" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Mugwump.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="258">
|
||||
<caret line="36" column="45" lean-forward="true" selection-start-line="36" selection-start-column="45" selection-end-line="36" selection-end-column="45" />
|
||||
<folding>
|
||||
<element signature="e#517#518#0" expanded="true" />
|
||||
<element signature="e#559#560#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="GradleLocalSettings">
|
||||
<option name="externalProjectsViewState">
|
||||
<projects_view />
|
||||
</option>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/src/barnestr/Mugwump.java" />
|
||||
<option value="$PROJECT_DIR$/src/barnestr/Warrior.java" />
|
||||
<option value="$PROJECT_DIR$/src/barnestr/Die.java" />
|
||||
<option value="$PROJECT_DIR$/src/barnestr/Lab07.java" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
<sorting>DEFINITION_ORDER</sorting>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds" extendedState="6">
|
||||
<option name="x" value="941" />
|
||||
<option name="y" value="52" />
|
||||
<option name="width" value="974" />
|
||||
<option name="height" value="1047" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
<manualOrder />
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="AndroidView" />
|
||||
<pane id="Scratches" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="Battle Simulator 3000" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Battle Simulator 3000" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="Battle Simulator 3000" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Battle Simulator 3000" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="Battle Simulator 3000" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="Battle Simulator 3000" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="src" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="barnestr" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="PackagesPane" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="aspect.path.notification.shown" value="true" />
|
||||
<property name="project.structure.last.edited" value="Modules" />
|
||||
<property name="project.structure.proportion" value="0.0" />
|
||||
<property name="project.structure.side.proportion" value="0.0" />
|
||||
<property name="last_opened_file_path" value="$USER_HOME$/Documents/SE 1021/Labs/Lab6" />
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
<option name="ruleStates">
|
||||
<list>
|
||||
<RuleState>
|
||||
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
<RuleState>
|
||||
<option name="name" value="StatusDashboardGroupingRule" />
|
||||
</RuleState>
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager" selected="Application.Lab07">
|
||||
<configuration name="Lab07" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="barnestr.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="MAIN_CLASS_NAME" value="barnestr.Lab07" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<module name="Battle Simulator 3000" />
|
||||
<envs />
|
||||
</configuration>
|
||||
<configuration default="true" type="Applet" factoryName="Applet">
|
||||
<option name="HTML_USED" value="false" />
|
||||
<option name="WIDTH" value="400" />
|
||||
<option name="HEIGHT" value="300" />
|
||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||
<module />
|
||||
</configuration>
|
||||
<configuration default="true" type="Application" factoryName="Application">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="ENABLE_SWING_INSPECTOR" value="false" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<module name="" />
|
||||
<envs />
|
||||
</configuration>
|
||||
<configuration default="true" type="JUnit" factoryName="JUnit">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<module name="" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="PACKAGE_NAME" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="METHOD_NAME" />
|
||||
<option name="TEST_OBJECT" value="class" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<option name="TEST_SEARCH_SCOPE">
|
||||
<value defaultName="singleModule" />
|
||||
</option>
|
||||
<envs />
|
||||
<patterns />
|
||||
</configuration>
|
||||
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<module name="" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<predefined_log_file id="idea.log" enabled="true" />
|
||||
</configuration>
|
||||
<configuration default="true" type="Remote" factoryName="Remote">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
<configuration default="true" type="TestNG" factoryName="TestNG">
|
||||
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
|
||||
<module name="" />
|
||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
||||
<option name="ALTERNATIVE_JRE_PATH" />
|
||||
<option name="SUITE_NAME" />
|
||||
<option name="PACKAGE_NAME" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="METHOD_NAME" />
|
||||
<option name="GROUP_NAME" />
|
||||
<option name="TEST_OBJECT" value="CLASS" />
|
||||
<option name="VM_PARAMETERS" value="-ea" />
|
||||
<option name="PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
|
||||
<option name="OUTPUT_DIRECTORY" />
|
||||
<option name="ANNOTATION_TYPE" />
|
||||
<option name="ENV_VARIABLES" />
|
||||
<option name="PASS_PARENT_ENVS" value="true" />
|
||||
<option name="TEST_SEARCH_SCOPE">
|
||||
<value defaultName="singleModule" />
|
||||
</option>
|
||||
<option name="USE_DEFAULT_REPORTERS" value="false" />
|
||||
<option name="PROPERTIES_FILE" />
|
||||
<envs />
|
||||
<properties />
|
||||
<listeners />
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list size="1">
|
||||
<item index="0" class="java.lang.String" itemvalue="Application.Lab07" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false">
|
||||
<option name="remove_strategy" value="false" />
|
||||
</component>
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="25280807-8910-45ca-9812-831d60f194d1" name="Default" comment="" />
|
||||
<created>1508177297503</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1508177297503</updated>
|
||||
<workItem from="1508177304946" duration="9528000" />
|
||||
<workItem from="1508453027085" duration="3221000" />
|
||||
<workItem from="1508704859697" duration="19539000" />
|
||||
<workItem from="1508816088447" duration="662000" />
|
||||
<workItem from="1508872533689" duration="36000" />
|
||||
<workItem from="1510712862952" duration="440000" />
|
||||
<workItem from="1510761480041" duration="73000" />
|
||||
<workItem from="1511590776410" duration="639000" />
|
||||
<workItem from="1516916855761" duration="15000" />
|
||||
<workItem from="1523939709029" duration="943000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="35096000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Palette	" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32979852" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="CheckStyle" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13645834" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<option name="time" value="4" />
|
||||
</breakpoint-manager>
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="306">
|
||||
<caret line="24" column="0" lean-forward="true" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/../Week 4/src/barnestr/Lab4.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="136">
|
||||
<caret line="8" column="51" lean-forward="false" selection-start-line="8" selection-start-column="51" selection-end-line="8" selection-end-column="51" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Mugwump.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="408">
|
||||
<caret line="28" column="7" lean-forward="false" selection-start-line="28" selection-start-column="7" selection-end-line="28" selection-end-column="7" />
|
||||
<folding>
|
||||
<element signature="e#517#518#0" expanded="true" />
|
||||
<element signature="e#559#560#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Warrior.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="238">
|
||||
<caret line="14" column="24" lean-forward="false" selection-start-line="14" selection-start-column="24" selection-end-line="14" selection-end-column="24" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Lab07.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="2567">
|
||||
<caret line="151" column="21" lean-forward="false" selection-start-line="151" selection-start-column="21" selection-end-line="151" selection-end-column="21" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="136">
|
||||
<caret line="8" column="51" lean-forward="false" selection-start-line="8" selection-start-column="51" selection-end-line="8" selection-end-column="51" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/Battle Simulator 3000.iml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Mugwump.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="408">
|
||||
<caret line="28" column="7" lean-forward="false" selection-start-line="28" selection-start-column="7" selection-end-line="28" selection-end-column="7" />
|
||||
<folding>
|
||||
<element signature="e#517#518#0" expanded="true" />
|
||||
<element signature="e#559#560#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Warrior.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="238">
|
||||
<caret line="14" column="24" lean-forward="false" selection-start-line="14" selection-start-column="24" selection-end-line="14" selection-end-column="24" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Lab07.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="306">
|
||||
<caret line="18" column="25" lean-forward="false" selection-start-line="18" selection-start-column="25" selection-end-line="18" selection-end-column="25" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Lab07.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1615">
|
||||
<caret line="95" column="45" lean-forward="false" selection-start-line="95" selection-start-column="45" selection-end-line="95" selection-end-column="45" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Mugwump.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="68">
|
||||
<caret line="4" column="0" lean-forward="true" selection-start-line="4" selection-start-column="0" selection-end-line="4" selection-end-column="0" />
|
||||
<folding>
|
||||
<element signature="e#517#518#0" expanded="true" />
|
||||
<element signature="e#559#560#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/../Week 5/src/barnestr/Lab5.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="680">
|
||||
<caret line="46" column="9" lean-forward="false" selection-start-line="46" selection-start-column="9" selection-end-line="46" selection-end-column="9" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/../Week 6/src/barnestr/BuildingCostEstimator.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/Battle Simulator 3000.iml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/../Week 4/Week 4.iml">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/../Week 4/src/barnestr/Lab4.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="0">
|
||||
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Die.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="289">
|
||||
<caret line="23" column="1" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Lab07.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="1802">
|
||||
<caret line="106" column="71" lean-forward="false" selection-start-line="106" selection-start-column="71" selection-end-line="106" selection-end-column="71" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Warrior.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="-198">
|
||||
<caret line="14" column="24" lean-forward="false" selection-start-line="14" selection-start-column="24" selection-end-line="14" selection-end-column="24" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/src/barnestr/Mugwump.java">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="258">
|
||||
<caret line="36" column="45" lean-forward="true" selection-start-line="36" selection-start-column="45" selection-end-line="36" selection-end-column="45" />
|
||||
<folding>
|
||||
<element signature="e#517#518#0" expanded="true" />
|
||||
<element signature="e#559#560#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ArtifactsStructureConfigurable.UI">
|
||||
<settings>
|
||||
<artifact-editor />
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="FacetStructureConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>No facets are configured</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="GlobalLibrariesConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="JdkListConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>1.8</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ModuleStructureConfigurable.UI">
|
||||
<settings>
|
||||
<last-edited>Battle Simulator 3000</last-edited>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
<option value="0.6" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
<state key="ProjectLibrariesConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
package barnestr;
|
||||
|
||||
public class Die {
|
||||
private int numSides;
|
||||
private int currentValue;
|
||||
|
||||
public Die(int sides) {
|
||||
this.numSides = sides; // Number of sides on die
|
||||
roll(); // Rolls die to decide currentValue
|
||||
}
|
||||
|
||||
public int getNumSides() {
|
||||
return numSides;
|
||||
}
|
||||
|
||||
public int getCurrentValue() {
|
||||
return currentValue;
|
||||
}
|
||||
|
||||
public void roll() {
|
||||
currentValue = ((int) (Math.random() * numSides)) + 1;
|
||||
}
|
||||
|
||||
}
|
||||
171
Fall 2017/SE 1011/Battle Simulator 3000/src/barnestr/Lab07.java
Normal file
171
Fall 2017/SE 1011/Battle Simulator 3000/src/barnestr/Lab07.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package barnestr;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Lab07 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String result = "";
|
||||
Scanner in = new Scanner(System.in);
|
||||
// TODO
|
||||
// game loop
|
||||
do {
|
||||
// print the introduction and rules
|
||||
intro();
|
||||
// initialize game
|
||||
Mugwump mugwump = new Mugwump();
|
||||
Warrior warrior = new Warrior();
|
||||
// while neither combatant has lost all of their hit points, battle!
|
||||
while (mugwump.getHitPoints() > 0 && warrior.getHitPoints() > 0) {
|
||||
result = battle(warrior, mugwump, in);
|
||||
report(warrior, mugwump);
|
||||
}
|
||||
victory(result);
|
||||
// declare the winner
|
||||
// ask to play again
|
||||
} while (playAgain(in));
|
||||
// Thank the user for playing your game
|
||||
System.out.println("Thank you for playing Battle Simulator 3000!");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method displays the introduction to the game and gives a description of the rules.
|
||||
*/
|
||||
private static void intro() {
|
||||
// TODO
|
||||
System.out.println("Welcome to Battle Simulator 3000! " +
|
||||
"The world's more low tech battle simulator!\n" +
|
||||
"You are a Valiant Warrior defending your humble village from an evil Mugwump! " +
|
||||
"Fight bravely, \n" +
|
||||
"or the citizens of your town will be the Mugwump's dinner!\n");
|
||||
System.out.println("You have your Trusty Sword, which deals decent damage, " +
|
||||
"but can be tough to hit with sometimes. \n" +
|
||||
"You also have your Shield of Light, which is not as strong as your sword, " +
|
||||
"but is easier to deal \n" +
|
||||
"damage with.\n" +
|
||||
"Let the epic battle begin!");
|
||||
}
|
||||
|
||||
/**
|
||||
* This method handles the battle logic for the game.
|
||||
*
|
||||
* @param warrior The Warrior of Light!
|
||||
* @param mugwump The Evil Mugwump!
|
||||
* @return The name of the victor, or "none", if the battle is still raging on
|
||||
*/
|
||||
private static String battle(Warrior warrior, Mugwump mugwump, Scanner in) {
|
||||
// determine who attacks first
|
||||
int initiative = initiative();
|
||||
int warriorDamage = warrior.attack(attackChoice(in));
|
||||
int mugwumpDamage = mugwump.attack();
|
||||
// attack!
|
||||
if (initiative == 1) {
|
||||
mugwump.takeDamage(warriorDamage);
|
||||
System.out.println("The Mugwump took " + warriorDamage + " point(s) of damage");
|
||||
if (mugwump.getHitPoints() >= 0) {
|
||||
warrior.takeDamage(mugwumpDamage);
|
||||
System.out.println("The Warrior took " + mugwumpDamage + " point(s) of damage");
|
||||
}
|
||||
} else if (initiative == 2) {
|
||||
warrior.takeDamage(mugwumpDamage);
|
||||
System.out.println("The Warrior took " + mugwumpDamage + " point(s) of damage");
|
||||
if (warrior.getHitPoints() >= 0) {
|
||||
mugwump.takeDamage(warriorDamage);
|
||||
System.out.println("The Mugwump took " + warriorDamage + " point(s) of damage");
|
||||
|
||||
}
|
||||
}
|
||||
if (warrior.getHitPoints() <= 0) {
|
||||
return "mugwump";
|
||||
} else if (mugwump.getHitPoints() <= 0) {
|
||||
return "warrior";
|
||||
} else {
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method reports the status of the combatants before each new round
|
||||
*
|
||||
* @param warrior The Warrior of Light!
|
||||
* @param mugwump The Evil Mugwump!
|
||||
*/
|
||||
private static void report(Warrior warrior, Mugwump mugwump) {
|
||||
// TODO
|
||||
System.out.println("Warrior HP: " + warrior.getHitPoints());
|
||||
System.out.println("Mugwump HP: " + mugwump.getHitPoints());
|
||||
}
|
||||
|
||||
/**
|
||||
* This method asks the user what attack type they want to use and returns the result
|
||||
*
|
||||
* @return 1 for sword, 2 for shield
|
||||
*/
|
||||
private static int attackChoice(Scanner in) {
|
||||
while (true) {
|
||||
System.out.println("How would you like to attack? " +
|
||||
"('1' for Trusty Sword or '2' for Shield of Light!)");
|
||||
int choice = in.nextInt();
|
||||
in.nextLine();
|
||||
if (choice == 1) {
|
||||
return 1;
|
||||
} else if (choice == 2) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines which combatant attacks first, displays and returns the result.
|
||||
*
|
||||
* @return 1 if the warrior goes first, 2 if the mugwump goes first
|
||||
*/
|
||||
private static int initiative() {
|
||||
Die d10 = new Die(10);
|
||||
int warriorRoll;
|
||||
int mugwumpRoll;
|
||||
d10.roll();
|
||||
warriorRoll = d10.getCurrentValue();
|
||||
d10.roll();
|
||||
mugwumpRoll = d10.getCurrentValue();
|
||||
do {
|
||||
if (warriorRoll > mugwumpRoll) {
|
||||
return 1;
|
||||
} else if (mugwumpRoll > warriorRoll) {
|
||||
return 2;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method declares the winner of the epic battle
|
||||
*
|
||||
* @param winner the name of the winner of the epic battle
|
||||
*/
|
||||
private static void victory(String winner) {
|
||||
// TODO
|
||||
if (winner.equals("warrior")) {
|
||||
System.out.println("The citizens cheer and invite you back to town " +
|
||||
"for a feast as thanks for saving their lives (again)!\n");
|
||||
} else {
|
||||
System.out.println("You lost! The Mugwump has defeated you and feasted " +
|
||||
"on the village people!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method asks the user if they would like to play again
|
||||
*
|
||||
* @param in Scanner
|
||||
* @return true if yes, false otherwise
|
||||
*/
|
||||
private static boolean playAgain(Scanner in) {
|
||||
System.out.println("Would you like to play again?");
|
||||
String choice = in.nextLine();
|
||||
if (choice.equals("yes") || choice.equals("Yes") ||
|
||||
choice.equals("y") || choice.equals("Y")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package barnestr;
|
||||
|
||||
public class Mugwump {
|
||||
// add methods here
|
||||
private int hitPoints;
|
||||
private int maxHitPoints;
|
||||
private Die d100;
|
||||
private Die d20;
|
||||
private Die d10;
|
||||
private Die d6;
|
||||
|
||||
public Mugwump() {
|
||||
d100 = new Die(100);
|
||||
d20 = new Die(20);
|
||||
d10 = new Die(10);
|
||||
d6 = new Die(6);
|
||||
hitPoints = rollHitPoints();
|
||||
maxHitPoints = hitPoints;
|
||||
}
|
||||
|
||||
public int getHitPoints() {
|
||||
return hitPoints;
|
||||
}
|
||||
|
||||
public void takeDamage(int hp) {
|
||||
hitPoints = hitPoints - hp;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method handles the attack logic
|
||||
*
|
||||
* @return the amount of damage an attack has caused, 0 if the attack misses or the Mugwump heals
|
||||
*/
|
||||
public int attack() {
|
||||
int damage = 0;
|
||||
// get attack type from ai
|
||||
d20.roll(); // roll for attack chance
|
||||
if (ai() == 1) {
|
||||
if (d20.getCurrentValue() >= 12) {
|
||||
for (int i = 2; i > 0; i--) {
|
||||
d6.roll();
|
||||
damage = damage + d6.getCurrentValue();
|
||||
}
|
||||
}
|
||||
} else if (ai() == 2) {
|
||||
|
||||
if (d20.getCurrentValue() >= 16) {
|
||||
for (int i = 3; i > 0; i--) {
|
||||
d6.roll();
|
||||
damage = damage + d6.getCurrentValue();
|
||||
}
|
||||
}
|
||||
} else if (ai() == 3) {
|
||||
d6.roll();
|
||||
if (hitPoints + d6.getCurrentValue() >= maxHitPoints) {
|
||||
hitPoints = maxHitPoints;
|
||||
} else {
|
||||
hitPoints = hitPoints + d6.getCurrentValue();
|
||||
}
|
||||
}
|
||||
// roll attack die
|
||||
|
||||
// determine results of attack
|
||||
|
||||
// return the damage
|
||||
return damage;
|
||||
}
|
||||
|
||||
private int rollHitPoints() {
|
||||
for (int i = 10; i > 0; i--) {
|
||||
d10.roll();
|
||||
hitPoints = hitPoints + d10.getCurrentValue();
|
||||
}
|
||||
return hitPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method determines what action the Mugwump performs
|
||||
*
|
||||
* @return 1 for a Claw attack, 2 for a Bite, and 3 if the Mugwump licks its wounds, instead
|
||||
*/
|
||||
private int ai() {
|
||||
d100.roll();
|
||||
if (d100.getCurrentValue() < 75) {
|
||||
// 75% Chance of a claw attack
|
||||
return 1;
|
||||
} else if (75 < d100.getCurrentValue() && d100.getCurrentValue() < 91) {
|
||||
// 15% Chance of a fang attack
|
||||
return 2;
|
||||
} else {
|
||||
// 10% Chance of Mugwump heal
|
||||
return 3;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package barnestr;
|
||||
|
||||
public class Warrior {
|
||||
private int hitPoints;
|
||||
private Die d20;
|
||||
private Die d10;
|
||||
private Die d8;
|
||||
private Die d4;
|
||||
|
||||
public Warrior() {
|
||||
d20 = new Die(20);
|
||||
d10 = new Die(10);
|
||||
d8 = new Die(8);
|
||||
d4 = new Die(4);
|
||||
rollHitPoints();
|
||||
}
|
||||
|
||||
public int getHitPoints() {
|
||||
return hitPoints;
|
||||
}
|
||||
|
||||
private int rollHitPoints() {
|
||||
for (int i = 6; i > 0; i--) {
|
||||
d10.roll();
|
||||
hitPoints = hitPoints + d10.getCurrentValue();
|
||||
}
|
||||
return hitPoints;
|
||||
}
|
||||
|
||||
public void takeDamage(int hp) {
|
||||
hitPoints = hitPoints - hp;
|
||||
}
|
||||
|
||||
public int attack(int type) {
|
||||
int damage = 0;
|
||||
d20.roll(); // roll for attack chance
|
||||
if (type == 1) {
|
||||
if (d20.getCurrentValue() >= 12) {
|
||||
for (int i = 2; i > 0; i--) {
|
||||
d8.roll();
|
||||
damage = damage + d8.getCurrentValue();
|
||||
}
|
||||
}
|
||||
} else if (type == 2) {
|
||||
if (d20.getCurrentValue() >= 8) {
|
||||
d4.roll();
|
||||
damage = damage + d4.getCurrentValue();
|
||||
|
||||
}
|
||||
}
|
||||
// roll attack die
|
||||
|
||||
// determine results of attack
|
||||
|
||||
// return the damage
|
||||
return damage;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user