Skip to content
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

Fixing error in merge where old code in CardBase was readded #37

Merged
merged 4 commits into from
Jan 5, 2024

Conversation

JonaLam
Copy link
Collaborator

@JonaLam JonaLam commented Dec 28, 2023

Description

Removed an old card effect system which got readded in a merge

Related issue(s)

#36

List of changes

Removed unecesary variables and functions from CardBase
Small changes in CardBase Recources to make some of them work, primaraly heal

Copy link
Collaborator

@Turtyo Turtyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will need to check that in local too.
When you modified the cards, did you do that via your text editor or did you use Godot's inspector ? Because looking at some of those resources, it seems like they might be missing some data to work (might just be me, as i said, i didn't test in local yet)

Cards/CardBase.gd Outdated Show resolved Hide resolved
@Turtyo
Copy link
Collaborator

Turtyo commented Jan 1, 2024

I tested in local. It works fine. You should just remove the Card_EnemyAttack.tres from the player deck to not have a card with NULL in hand. Also maybe damage all should be removed since it doesn't do anything currently

Copy link
Collaborator

@Tomzkk Tomzkk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to check by comparing what was removed from here with #27 and it looks like the removed stuff should be okay. Left a comment, I'm not entirely sure if that was changed at some later point or if that's a missing change. If it's missing there might be more like that ?

Cards/CardBase.gd Show resolved Hide resolved
@Turtyo
Copy link
Collaborator

Turtyo commented Jan 1, 2024

Let's only merge this one after #22 is merged to prevent another merge conflict on an old PR

@Turtyo
Copy link
Collaborator

Turtyo commented Jan 2, 2024

#22 was closed to be reopened in a new and cleaner PR, waiting for this new PR to merge #37

@Tysterman74 Tysterman74 mentioned this pull request Jan 2, 2024
@Turtyo Turtyo linked an issue Jan 5, 2024 that may be closed by this pull request
@Turtyo
Copy link
Collaborator

Turtyo commented Jan 5, 2024

After looking, merging this one now shouldn't give problems with 22 so we'll squash merge now

@Turtyo Turtyo merged commit e40671e into Saplings-Projects:main Jan 5, 2024
1 check passed
Tysterman74 added a commit that referenced this pull request Jan 17, 2024
* Added a base template for effects and relevant functions in CardBase

* Reformated to use a list of targets and moved some functions to other files

- The CardBase applies all effects when played
- The application of effect is done given the card data (parser TODO)
- This application will be done to all targets in the list
- This calls the apply_effect which is done to individual targets

* Update Battler to have correct function signature

* Simplified _damage_entity since the new logic of effects is applied to one target at once

* Simplified can_play_card

* Moved the draw to an effect, changed value from float to int

* Moved the discard random to an effect

* Made the EffectPoison to have a reference for other Status effects

* Moved the deal damage to an effect

* Changed effects from Node to Resource

* Modified Battler and Enemy to work with the new effect structure

* Changed EffectData to prevent an init bug | Added basic targeting function

* Modified EffectDamage

* Modified damage and draw resources cards to work with new effect system

* Modified poison to work with new system

* Added a card with multiple effects to test the current structure

It works btw

* Tried an effect that was a bit more complex

It worked nicely. This card probably won't stay as it is, that would be OP
But it's nice to test that the system is working

* Include `map-implementation` in the CI

* Changed parameter name from entity to target for more clarity

* Removed unused commented line in tests

* Updated README

* Updated CONTRIBUTING.md

I'm not sure if I forgot something that was mentionned during the PR or not

* Issue 20: Events Structure (#29)

* Create Event Parent and Event Child Classes

* Issue 20: Update Event Children with scene string instantiation, Create Events Classification script to hold enums for different events and added it to AutoLoader

* Issue 20: Add comment for test function

* Issue-20: Rename Event classes, remove EventsClassification enum

* Issue-20: Update EventBase to have array of different types of events. Update init() as well.

* Issue-20: Update EventBase Array holding all Events, Add Unit Test for EventBase

* Added a section for commits in CONTRIBUTING.md

* Added DOCUMENTATION.md, added sections and wrote the effect part

* Wrote Status section of DOCUMENTATION

* Reworded parts of CONTRIBUTING.md for more clarity

* Wrote Rooms, Events and light level section in DOCUMENTATION

* Wrote the Unique events section of DOCUMENTATION

This is still in discussion, so this part of the documentation is subject to future changes

* Added a guideline for pull request in CONTRIBUTING.md

* very basic classes for room, floor, and map, and a new scene for map development

added:
Map folder for map files
FloorBase class
MapBase class
RoomBase class
MapTest scene to develop the map without conflicting with the cards system

* room generator

Added function into MapManager that populates a floor's rooms. also added a test function

* Last second change

Fixed some formatting stuff

* Pull request feedback changes

removed FloorBase (changed scripts to reflect this)
removed MapTest scene
removed RoomType.UNKNOWN
removed RoomBase.get_room_type function
removed mob_chance
removed max_mob_spawns
removed signal populate_floor
removed signal populated_floor
added RoomBase.coordinates
changed RoomType to RoomEvent
changed MapBase.rooms to 2d array
renamed this_room_type to this_room_event
renamed Map to MapBase
renamed Room to RoomBase

* More feedback changes + event classes

removed MapBase.height
changed MapBase.width to array
removed RoomBase.coordinates
removed parameters on MapManager.create_map
renamed MapManager.generate_rooms to create_map
changed generation to work with event classes

* Added images to the map section of DOCUMENTATION

* Updated the light mechanic explanation image for the documentation

* Explaining how players view events on the map

Will an image be required for this ?

* Added a paragraph to explain light levels and the influence of light on the rooms before the example

* Feedback changes

Added GLOBAL_VAR autoload and var EVENTS_CLASSIFICATION
changed tests to use GlobalVar
changed test_map_gen to use assert_not_null()
moved EventBase.EVENTS_CLASSIFICATION to GLOBAL_VAR
renamed MapBase.width to floors_width
renamed RoomBase.this_room_event to room_event

* Feedback changes: review edition

Changed create_map loop order
Changed create_map append to assign room type instead of placeholder
Changed map width to reflect shape rules

* Deck animation and layout (#25)

* Add CardMovementComponent

-Add states, but they don't do anything yet. Just lerp to desired position
-Replace LerpComponent on Card scene

* Change CardContainer and CardWorld to Control

Change from Node2D to Control, this way we can anchor the CardContainer to the bottom of the screen

* Add card draw/discard queue system

Cards now draw and discard in a queue. To remove or draw a card, it is first added to a queue. Queued cards get removed/added from the queue on a looping timer

-Cards are removed from draw pile immediately when a draw is requested. They are added to the queue so they can be spawned async
-Cards are added to the discard pile immediately when a discard is requested. They are added to the queue to be destroyed async.
This means that cards technically exist in the draw/discard immediately when the request is given, but the world versions of the cards may spawn/destroy at a later time.

* Add CardMovementState resource

-Add CardMovementState as a Resource. So each state will be a separate file
-Added child states InHand, MovingToHand, and Discarding
-Added CardState properties which gives values for the card states
-Added EasingConstants which is string constants used for easing

* Add better card separation

Cards now separate based on a max and min value. Cards will squish closer together if there are a lot of cards in your hand. If you only have a small amount of cards in your hand, they will be centered

* Fix z-ordering of cards

Cards are moved to the top of the hierarchy if they are hovered. This makes it to where cards below this card can't be hovered.

* Other cards scoot out of the way when you hover one

When you hover a card, other cards in your hand scoot out of the way to give room for the hovered card

* Add y-offset and rotation curve to cards in hand

* Add HOVERED and QUEUED states

* Remove state switch in CardContainer

* Smooth rotation Hover and Queued states

* Organize state values. Fix MOVING_TO_HAND state

MOVING_TO_HAND state was not easing to the correct position

* Fix offset in QUEUED

* Move discard and draw timers

Moved timers to the end of the draw queue functions so the cards aren't discarded and drawn with a starting delay

* Naming cleanup. Fix weird movement with discarding state

* Fix movement issue with focus card

Focus card not getting set to null when played

* Ease rotation on discarding state

* Bind input only when the card is finished moving

* Restrict end turn button press

Only allow when cards are finished dealing and you have no card queued

* Static typing and cleanup

* Fix tests by adding on_cards_finished_dealing

Wait for cards to finish dealing before checking cards in test_cards

Removed PhaseManager.on_game_start check in test_health because the tests would never start. Since test_health isn't the first test anymore it never recieved the signal. Wasn't needed anyways

* Change CardStateProperties to Resource instead of Node

* Further commenting and cleanup

* Issue-25: Update naming for _state_not_null(), clean up readability for pulling card to start discard animation

* Issue-25: Rename LERP_SPEED to MOVE_SPEED for readability, added active_cards array to determine if all active cards are done doing their action

* Issue-12: Update active_cards from an array to just a single CardWorld object

---------

Co-authored-by: tynutsathitya <tynutsathitya@gmail.com>

* Changed map generation to be more accurate to references

create_map() now generates to reflect the map shape reference (https://github.com/Saplings-Projects/1M_sub/issues/6#issue-2027403379)(https://github.com/Saplings-Projects/1M_sub/pull/30#issuecomment-1868931059)

changed floors_width to reflect basic math

* Static typing fixes

added static typing where there was not any

* Feedback changes

Static typing changes
Added create_map return type

changed map generation (optimization)

(MapBase.rooms holds arrays of rooms, one for each floor)

* Test changes

create_map now has configurable width for testing
changed test for a small floor (reference)

* Fixed tests

fixed unintended test changes

* Fixing error in merge where old code in CardBase was readded  (#37)

* Cut all of the unnecessary code in CardBase

* Changes to the card resource to make sure they work

* Removed unnecessarily _damage_entirt function

* Removed cards that don't do anything

* Feedback changes

changed create_map(_layout) > create_map(floors_width)
added room padding to both before and after rooms are generated
changed tests to use a fixed list

* CardPileUicl (#40)

* Added a WIP buttom that shows a new scene

* The button now shows a new scene with
a return button to go back to the game.
The game cannot be played while the scene is present.

* The button now shows a new scene with
a return button to go back to the game.
The game cannot be played while the scene is present.

* added Typing

* Added CardScrollUI to see the inside of a CardPile

* Added CardScrollUI to see the inside of a CardPile

* Changed event to input_event and added its type

* Updated the the min size of the CardUI

* Fixed the aftermath of merging

* Added constant for the card.

* Deleted a function that is irrelevant.

* Moved the ShowCardPile into CardPileUISetter

* Deck doesn't need to have a card count.

* resized ScrollContainer to show 5 columns and 2 rows

* Added a button to show cards inside the deck

* Fixed the code that modifies the card and adds it to the container.

* Whitespace be gone

* Changed the settings of GridContainer so cards first show in the center

* Print statement begone

* added the "pile" after deck so it is consistent to the others pile

* Added a test for cardscrollui

* Fixed the test so it gets the proper gridcontainer

* Changed _input function to use a key constant instead of a string.

* Changed the settings of GridContainer so cards first show in the center part 2

* Addressed review feedback from Ty

* Addressed review feedback from Turtyo

* Changed the test so it compares Cardbases

* added a comment to the input function.

* potential fix to errors in test

* amendment for the last commit

* Fixed a function, fixed the test?, and cards not appearing in the UI.

* Fixed the testing scene after the merge

* whitespace be gone

---------

Co-authored-by: Turtyo <49365680+Turtyo@users.noreply.github.com>

* Feedback changes

changed create_map(layout) to create_map(map_floors_width)

changed insert in create_map() to append
changed test error message formatting
added override _to_string() in RoomBase, this will have more added in the future

* Test optimizations

changed assert_not_null(test_map.rooms) to assert_not_null(_room) in map test

---------

Co-authored-by: Turtyo <49365680+Turtyo@users.noreply.github.com>
Co-authored-by: Sapling Forest <149967937+Saplings-Projects@users.noreply.github.com>
Co-authored-by: Tyler Nutsathitya <tynutsathitya@gmail.com>
Co-authored-by: minik <miniiiiiik@gmail.com>
Co-authored-by: cheesefrycook <151570126+cheesefrycook@users.noreply.github.com>
Co-authored-by: Jona Lam <89871543+JonaLam@users.noreply.github.com>
Co-authored-by: Paper-2 <65647380+Paper-2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixing error in merge where old code in CardBase was readded
4 participants