-
Notifications
You must be signed in to change notification settings - Fork 12
Pull request for sample_npc.h, sample_npc.c, genstruct.c, and default_room #639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
navila-luna
wants to merge
47
commits into
dev
Choose a base branch
from
openworld/samples-npcs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
a63893d
including npcs in spec room struct and functions
ed85e23
made edits to have npc_t struct considered
072a177
lets see
b812938
saving sample_npc.c
c40ae97
Merge remote-tracking branch 'origin/dev' into openworld/samples-npcs
dwahme ee9e84d
slight edits in autogeneration to include npcs
f95c171
added npcs in test, need to add room descriptions
c3a6f76
fixed errors in test_structs.c
045f5f4
Fixed errors in test_struct
909ffce
pushing
ef7c123
Merge branch 'dev' of https://github.com/uchicago-cs/chiventure into …
2c9cd61
fixed merge issues by simply deletin all and replacing it with Bryans…
b3e1486
look at autogenerate.c for my thought/confusion process
02bf49b
revamping npc structure and attempting integration into autogenerate
45cc244
successfully integrated default_npc into autogenerate. need to write …
abc268a
fixed merge conflict
3a15044
resolved merge conflicts
4d83aff
still need to fix test_autogenerate errors
a724869
Added tests and made default npcs hash-based
ac34586
Merge pull request #766 from uchicago-cs/openworld/autogenerate-bugs
carolinaecalderon 1c82bd1
Fixed final tests
3efc5e7
Merge branch 'openworld/samples-npcs' of https://github.com/uchicago-…
b6786c5
Editing comments
navila-luna 20ef151
rm since default_npcs is the updated duplicate
navila-luna daf6b6f
deleting the duplicate of samples-npcs file
baa8963
Merge branch 'openworld/samples-npcs' of https://github.com/uchicago-…
9854cfa
made some changes, will come back to more space comments
26027fd
went through all suggestions
4523676
minor changes
bbfd365
will fix comment issues in sample npc
2d742d3
changes to spaces
navila-luna 5204f90
added on to comment tests and fixed spelling issue in .c file
d82a55d
fixed merge issue
6610d3f
made changes in npc functions, need one more fix
4519c71
I think everythings done!
c5159b2
Merge branch 'dev' into openworld/samples-npcs
navila-luna 6f47f0f
went back for tabs issues
navila-luna c0bcacb
went back for tabs issues
navila-luna b46c5ce
went through for any spacing issues not seen before
navila-luna fb4dd03
fixed overlooked tabs
navila-luna 768e26a
fixed overlooked tab issue
navila-luna 2048461
fixed overlooks spacing issues
navila-luna 4d43dc4
fixed tab issues
navila-luna 9f4dea9
I really hope spacing issues are resolved
7865488
fixed merges and spaces thru astyles
d812be2
Merge branch 'dev' into openworld/samples-npcs
navila-luna 204008d
Merge branch 'dev' into openworld/samples-npcs
navila-luna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /* Team RPG-Openworld | ||
| * | ||
| * Default NPC header file | ||
| * | ||
| * default_npc.h: This file: contains all of the necessary npc structs and functions | ||
| * that are necessary to move npcs in a autogenerated room | ||
| * | ||
| * See chiventure/src/openworld/default_npc.c source code to see implementation. | ||
| */ | ||
| #ifndef _DEFAULT_NPCS_H | ||
| #define _DEFAULT_NPCS_H | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <stdbool.h> | ||
| #include "game-state/game_state_common.h" | ||
|
|
||
| // Assigns the max_name_lenght an NPC can have | ||
| #define MAX_NAME_LEN (50) | ||
|
|
||
| /* | ||
| * npc_classification | ||
| * Classification of the type of NPC characters to be found | ||
| * within the rooms. Where friendly means NPC doesn't engage in fights, | ||
| * Hostile means engages in fights, and generic means can engage in fights | ||
| */ | ||
|
|
||
| typedef enum npc_classification { | ||
| NPC_GENERIC = 0, | ||
| NPC_HOSTILE = 1, | ||
| NPC_FRIENDLY = 2 | ||
| } npc_classification_t; | ||
|
|
||
|
|
||
| /* npc_t struct | ||
| * This struct will carry the necessary info for creating a NPC in a room | ||
| * This struct contains: | ||
| * - int level: player level in game | ||
| * - char *npc_name: strings a NPC type and name, ex: wizard type Hostile | ||
| * - npc_classification_t classification: enum for the three types of NPCs | ||
| * - item_hash_t *item inventory: item inventory for the NPCs | ||
| */ | ||
| typedef struct npc | ||
| { | ||
| char *npc_name; | ||
| int level; | ||
| item_hash_t *inventory; | ||
| npc_classification_t classification; | ||
| struct npc *next; | ||
| struct npc *prev; | ||
| UT_hash_handle hh; | ||
| } npc_t; | ||
|
|
||
| /* get_hostile_npcs produces mock NPCs of type Hostile. | ||
| * Will recieve a linked list of hostile npcs and includes the items that | ||
| * each NPC carries with them makes 3 npcs that are hostile | ||
| * Input: | ||
| * - none | ||
| * Output: | ||
| * - a hash list of hostile npcs with their own items inventory | ||
| */ | ||
| npc_t *get_hostile_npcs(); | ||
|
|
||
|
|
||
| /* get_friendly_npcs produces mock NPCs of type Friendly | ||
| * makes 3 npcs that are friendly and includes the items that each NPC carries with them. | ||
| * Input: | ||
| * - none | ||
| * Output: | ||
| * - Returns them as a hash list | ||
| */ | ||
| npc_t *get_friendly_npcs(); | ||
|
|
||
|
|
||
|
|
||
| /* get_generic_npcs produces mock NPCs of type Generic | ||
| * Generic: NPCs that you can choose to be friendly or hostile with | ||
| * Function makes 3 npcs that are generic and includes the items that each NPC carries with them | ||
| * Input: | ||
| * - none | ||
| * Output: | ||
| * - puts the NPCs in as a hash list | ||
| */ | ||
| npc_t *get_generic_npcs(); | ||
|
|
||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all tabs- convert to spaces