1. Homepage
  2. Programming
  3. COMP1511 Programming Fundamentals - Assignment 2 - CS Dungeon!

COMP1511 Programming Fundamentals - Assignment 2 - CS Dungeon!

Engage in a Conversation
UNSWCOMP1511Programming FundamentalsCOMP1911CS DungeonC

Assignment 2 - CS Dungeon!

Your task in assignment 2 is to create a dungeon crawler game, where you will get to design a map of connected dungeons filled with monsters, items, and a final boss at the end to defeat! You will get to play as either a Fighter or a Wizard, using your special skills and stats to defeat these monsters and beat the game!

The game consists of a setup phase, where you add dungeons and items, and a gameplay phase, where you as the player will get to move between dungeons, fight monsters and collect items that can make you even stronger! CourseNana.COM

You can read about the history of dungeon crawler games here. CourseNana.COM

Overview

COMP1911 Students

If you are a COMP1911 student, you will be assessed on your performance in stages 1 and 2 ONLY for this assignment, which will make up the performance component of your grade. Style will be marked as usual and will make up the remaining 20% of the marks for this assignment. You are NOT required to attempt stages 3 and 4. You may attempt the later stages if you wish, but you will not be awarded any marks for work beyond stage 2. CourseNana.COM

COMP1511 Students

If you are a COMP1511 student, you will be assessed on your performance in stages 1 through 4, which will make up the performance component of your grade. Style will be marked as usual and will make up the remaining 20% of the marks for this assignment. CourseNana.COM

Assignment Structure

This assignment will test your ability to create, use, manipulate and solve problems using linked lists. To do this, you will be implementing a dungeon crawler game, where the dungeons are represented as a linked list, stored within a map. Each dungeon contains a list of items. The map also contains a player struct, which also contains a list of items. CourseNana.COM

We have defined some structs in the provided code to get you started. You may add fields to any of the structs if you wish. CourseNana.COM

CourseNana.COM

CourseNana.COM

The following enum definitions are also provided for you. You can create your own enums if you would like, but you should not modify the provided enums. CourseNana.COM

CourseNana.COM

CourseNana.COM

Getting Started

There are a few steps to getting started with CS Dungeon. CourseNana.COM

  1. Create a new folder for your assignment work and move into it. You can follow the commands below to link and copy the files.
mkdir ass2
cd ass2
  1. There are 3 files in this assignment. Run the following command below to download all 3, which will link the header file and the main file. This means that if we make any changes to cs_dungeon.h or main.c, you will not have to download the latest version as yours will already be linked.
1511 fetch-activity cs_dungeon
  1. Run 1511 autotest cs_dungeon to make sure you have correctly downloaded the file.
1511 autotest cs_dungeon
  1. Read through the rest of the introductory specification and Stage 1.

Starter Code

This assignment utilises a multi-file system. There are three files we use in CS Dungeon: CourseNana.COM

  • Main File (main.c): This file handles all input scanning and error handling for you. It also tests your code in cs_dungeon.c and contains the main function. You don't need to modify or fully understand this file, but if you're curious about how this assignment works, feel free to take a look. You cannot change main.c. CourseNana.COM

  • Header File (cs_dungeon.h): contains defined constants that you can use and function prototypes. It also contains header comments that explain what functions should do and their inputs and outputs. If you are confused about what a function should do, read the header file and the corresponding specification. You cannot change cs_dungeon.h. CourseNana.COM

  • Implementation File (cs_dungeon.c): contains stubs of functions for you to implement. This file does not contain a main function, so you will need to compile it alongside main.cThis is the only file you may change. You do not need to use scanf or fgets anywhere. CourseNana.COM

The implementation file cs_dungeon.c contains some provided functions to help simplify some stages of this assignment. These functions have been fully implemented for you and should not need to be modified to complete this assignment. CourseNana.COM

These provided functions will be explained in the relevant stages of this assignment. Please read the function comments and the specification as we will suggest certain provided functions for you to use. CourseNana.COM

How to Compile CS Dungeon

CourseNana.COM

CourseNana.COM

Reference Implementation

To help you understand the expected behaviour of CS Dungeon, we have provided a reference implementation. If you have any questions about the behaviour of your assignment, you can check and compare yours to the reference implementation. CourseNana.COM

To run the reference implementation, use the following command: CourseNana.COM

 1511 cs_dungeon

CourseNana.COM

CourseNana.COM

The easiest way to understand how this assignment works is to play a game yourself! Below is example input you can try by using the reference solution. CourseNana.COM

CourseNana.COM

CourseNana.COM

Allowed C Features

In this assignment, there are no restrictions on C Features, except for those in the Style Guide. If you choose to disregard this advice, you must still follow the Style Guide. CourseNana.COM

You also may be unable to get help from course staff if you use features not taught in COMP1511. Features that the Style Guide identifies as illegal will result in a penalty during marking. You can find the style marking rubric above. Please note that this assignment must be completed using only Linked Lists . Do not use arrays in this assignment. If you use arrays instead of linked lists you will receive a 0 for performance for this assignment. CourseNana.COM

Banned C Features

In this assignment, you cannot use arrays for the list of dungeons nor the lists of items and cannot use the features explicitly banned in the Style Guide. If you use arrays in this assignment for the linked list of dungeons or the linked lists of items you will receive a 0 for performance in this assignment. CourseNana.COM

FAQ

CourseNana.COM

CourseNana.COM

Game Structure

This game consists of a setup phase and a gameplay phase. CourseNana.COM

You will be implementing both the setup phase and gameplay phase throughout this assignment, adding more features to both as you progress. By the end of **stage 1.4****you will have implemented parts of both setup and gameplay enough to play a very basic game. CourseNana.COM

The game is ended either by the user entering Ctrl-D, the win condition being met, or the player running out of health points. The program can also be ended in the setup phase with Ctrl-D or q. CourseNana.COM

Your Tasks

This assignment consists of four stages. Each stage builds on the work of the previous stage, and each stage has a higher complexity than its predecessor. You should complete the stages in order. CourseNana.COM

A video explanation to help you get started with the assignment can here found here: CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

Stage 4

This stage is for students who want to challenge themselves, and solve more complicated linked lists and programming problems, such as: CourseNana.COM

  • Teleportation between dungeons
  • Defeating the final boss

Stage 4.1 - Teleportation Between Dungeons

In Stage 4.1, we’d like to be able to teleport the player between dungeons. CourseNana.COM

Enter Command: T

All dungeons can be teleported to. When the T command is entered, the player should teleport to the furthest dungeon from the current dungeon they are in, unless that dungeon has already been teleported to. Once all dungeons have been teleported to, the pattern can begin again. CourseNana.COM

For example, a map with 4 dungeons. If the player starts in the first dungeon, their movements would be as follows (the player is represented by the knight character): CourseNana.COM

stage4.4-1.svg CourseNana.COM

There is one function in cs_dungeon.c that you will have to implement for Stage 4.1teleportINVALID should be returned when there is only one dungeon in the map, otherwise, VALID should be returned. CourseNana.COM

Clarifications

  • Whenever the map is changed (by shuffling in Stage 4.2 or by removing empty dungeons), the teleportation movement should restart, as if no dungeons have been teleported to yet.
  • When the player moves between dungeons with > or <, the teleportation movement should restart, as if no dungeons have been teleported to yet.
  • If multiple dungeons are equidistant, the player should travel to the first one in the map.
  • The first dungeon the player starts the teleportation cycle in counts as being teleported to.

Examples

CourseNana.COM

CourseNana.COM

Stage 4.2 - The Final Boss

We have finally reached the final boss! When the final boss is attacked for the first time, it becomes so enraged, spreading its power across the dungeon, shaking things up so that the map becomes unrecognisable. In this stage you will be implementing the boss_fight function. CourseNana.COM

Enter Command: b

To be able to attack the final boss, the player must have the required item type in their inventory, not yet used. CourseNana.COM

When the player attacks the final boss, they should deal either physical damage or magical damage, as calculated in fight from Stage 2.4. They should do whichever does more damage. If the damage is equal, they should deal magical damage. CourseNana.COM

The first time the boss is attacked, the map should be shuffled, so that pairs of dungeons switch places. Below is an example diagram of a dungeon map containing 4 dungeons: CourseNana.COM

stage4.4-2.svg CourseNana.COM

When attacking a boss, the boss can sustain damage, and can be damaged across multiple turns. Bosses will fight back each turn the player is in the same dungeon, and when they reach 50% of their original health or less, they will do 1.5 times more damage. CourseNana.COM

Bosses will follow the player (but cannot teleport), and will attempt to reach the player by moving towards them each turn. If they are in the same dungeon as the player, they will attack. Bosses can move or attack, but not both in the same turn. CourseNana.COM

You will need to add code to your end_turn function. A turn should run as follows: CourseNana.COM

  1. Player action (including shuffling the map if it is the first time the boss is attacked)
  2. Monster attacks
  3. Remove any empty dungeons
  4. Boss attack or move
  5. Check if the game is over

If the player defeats the boss, then you should call the helper function print_boss_defeat after both the player and the boss have done their actions for the turn. CourseNana.COM

Clarifications

  • If there is an odd number of dungeons, e.g. 5 dungeons, swap the first 4, leaving the last dungeon in its original position.
  • boss_fight should return NO_BOSS when there is no boss present in the current dungeon, NO_ITEM when the player does not have the required item to fight the boss, and VALID otherwise.
  • Make sure to go back and check your code from Stage 3.1 to check if the boss has been defeated. If the boss is defeated, their points should be added to the player's point total.
  • Whenever the map is changed, the teleportation movement Stage 4.1 should restart, as if no dungeons have been teleported to yet.
  • The boss only start moving once attacked for the first time.
  • You may assume the same shield power logic as Stage 2.4 applies to the boss damage.

Examples

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

Testing and Submission

Remember to do your own testing CourseNana.COM

Are you finished with this stage? If so, you should make sure to do the following: CourseNana.COM

  • Run 1511 style and clean up any issues a human may have reading your code. Don't forget -- 20% of your mark in the assignment is based on style and readability!
  • Autotest for this stage of the assignment by running the autotest-stage command as shown below.
  • Remember -- give early and give often. Only your last submission counts, but why not be safe and submit right now?
1511 style cs_dungeon.c
1511 autotest-stage 04 cs_dungeon
give cs1511 ass2_cs_dungeon cs_dungeon.c

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM

CourseNana.COM


Get in Touch with Our Experts

WeChat (微信) WeChat (微信)
Whatsapp WhatsApp
UNSW代写,COMP1511代写,Programming Fundamentals代写,COMP1911代写,CS Dungeon代写,C代写,UNSW代编,COMP1511代编,Programming Fundamentals代编,COMP1911代编,CS Dungeon代编,C代编,UNSW代考,COMP1511代考,Programming Fundamentals代考,COMP1911代考,CS Dungeon代考,C代考,UNSWhelp,COMP1511help,Programming Fundamentalshelp,COMP1911help,CS Dungeonhelp,Chelp,UNSW作业代写,COMP1511作业代写,Programming Fundamentals作业代写,COMP1911作业代写,CS Dungeon作业代写,C作业代写,UNSW编程代写,COMP1511编程代写,Programming Fundamentals编程代写,COMP1911编程代写,CS Dungeon编程代写,C编程代写,UNSWprogramming help,COMP1511programming help,Programming Fundamentalsprogramming help,COMP1911programming help,CS Dungeonprogramming help,Cprogramming help,UNSWassignment help,COMP1511assignment help,Programming Fundamentalsassignment help,COMP1911assignment help,CS Dungeonassignment help,Cassignment help,UNSWsolution,COMP1511solution,Programming Fundamentalssolution,COMP1911solution,CS Dungeonsolution,Csolution,