mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 08:36:52 +00:00
Implemented basic fireball collision.
This commit is contained in:
@@ -12,7 +12,9 @@ func toPbRoomDownsyncFrame(rdf *battle.RoomDownsyncFrame) *pb.RoomDownsyncFrame
|
||||
ret := &pb.RoomDownsyncFrame{
|
||||
Id: rdf.Id,
|
||||
PlayersArr: make([]*pb.PlayerDownsync, len(rdf.PlayersArr), len(rdf.PlayersArr)),
|
||||
BulletLocalIdCounter: rdf.BulletLocalIdCounter,
|
||||
MeleeBullets: make([]*pb.MeleeBullet, len(rdf.MeleeBullets), len(rdf.MeleeBullets)),
|
||||
FireballBullets: make([]*pb.FireballBullet, len(rdf.FireballBullets), len(rdf.FireballBullets)),
|
||||
CountdownNanos: rdf.CountdownNanos,
|
||||
BackendUnconfirmedMask: rdf.BackendUnconfirmedMask,
|
||||
ShouldForceResync: rdf.ShouldForceResync,
|
||||
@@ -50,6 +52,7 @@ func toPbRoomDownsyncFrame(rdf *battle.RoomDownsyncFrame) *pb.RoomDownsyncFrame
|
||||
|
||||
for i, last := range rdf.MeleeBullets {
|
||||
pbBullet := &pb.MeleeBullet{
|
||||
BulletLocalId: last.BulletLocalId,
|
||||
OriginatedRenderFrameId: last.OriginatedRenderFrameId,
|
||||
OffenderJoinIndex: last.OffenderJoinIndex,
|
||||
|
||||
@@ -73,12 +76,50 @@ func toPbRoomDownsyncFrame(rdf *battle.RoomDownsyncFrame) *pb.RoomDownsyncFrame
|
||||
HitboxSizeY: last.HitboxSizeY,
|
||||
|
||||
BlowUp: last.BlowUp,
|
||||
|
||||
TeamId: last.TeamId,
|
||||
}
|
||||
ret.MeleeBullets[i] = pbBullet
|
||||
}
|
||||
|
||||
for i, last := range rdf.FireballBullets {
|
||||
pbBullet := &pb.FireballBullet{
|
||||
BulletLocalId: last.BulletLocalId,
|
||||
OriginatedRenderFrameId: last.OriginatedRenderFrameId,
|
||||
OffenderJoinIndex: last.OffenderJoinIndex,
|
||||
|
||||
StartupFrames: last.StartupFrames,
|
||||
CancellableStFrame: last.CancellableStFrame,
|
||||
CancellableEdFrame: last.CancellableEdFrame,
|
||||
ActiveFrames: last.ActiveFrames,
|
||||
|
||||
HitStunFrames: last.HitStunFrames,
|
||||
BlockStunFrames: last.BlockStunFrames,
|
||||
PushbackVelX: last.PushbackVelX,
|
||||
PushbackVelY: last.PushbackVelY,
|
||||
Damage: last.Damage,
|
||||
|
||||
SelfLockVelX: last.SelfLockVelX,
|
||||
SelfLockVelY: last.SelfLockVelY,
|
||||
|
||||
HitboxOffsetX: last.HitboxOffsetX,
|
||||
HitboxOffsetY: last.HitboxOffsetY,
|
||||
HitboxSizeX: last.HitboxSizeX,
|
||||
HitboxSizeY: last.HitboxSizeY,
|
||||
|
||||
BlowUp: last.BlowUp,
|
||||
TeamId: last.TeamId,
|
||||
|
||||
VirtualGridX: last.VirtualGridX,
|
||||
VirtualGridY: last.VirtualGridY,
|
||||
DirX: last.DirX,
|
||||
DirY: last.DirY,
|
||||
VelX: last.VelX,
|
||||
VelY: last.VelY,
|
||||
Speed: last.Speed,
|
||||
}
|
||||
ret.FireballBullets[i] = pbBullet
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
|
@@ -381,6 +381,9 @@ func (pR *Room) StartBattle() {
|
||||
|
||||
for _, player := range pR.Players {
|
||||
speciesId := int(player.JoinIndex - 1) // FIXME: Hardcoded the values for now
|
||||
if player.JoinIndex == 2 {
|
||||
speciesId = 4096
|
||||
}
|
||||
chosenCh := battle.Characters[speciesId]
|
||||
pR.CharacterConfigsArr[player.JoinIndex-1] = chosenCh
|
||||
pR.SpeciesIdList[player.JoinIndex-1] = int32(speciesId)
|
||||
|
Reference in New Issue
Block a user