Révision | fd70706d9afd3d7f296b6397fb086ac71f90377e (tree) |
---|---|
l'heure | 2016-01-20 17:01:38 |
Auteur | SUEHIRO <supersuehiro@user...> |
Commiter | SUEHIRO |
gethitvar(xoff)が累積しないのを修正
@@ -1002,16 +1002,6 @@ void appendToClipboard(int p, ^/char formatText, ^&.Var vars) | ||
1002 | 1002 | public float yvel; |
1003 | 1003 | public float yaccel; |
1004 | 1004 | public int hitid; |
1005 | - public float mindistx; | |
1006 | - public float maxdistx; | |
1007 | - public float mindisty; | |
1008 | - public float maxdisty; | |
1009 | - public float snapx; | |
1010 | - public float snapy; | |
1011 | - public int snapt; | |
1012 | - public short snapf; | |
1013 | - public bool snapfx; | |
1014 | - public bool snapfy; | |
1015 | 1005 | public float xoff; |
1016 | 1006 | public float yoff; |
1017 | 1007 | public &.Fall fall; |
@@ -1044,16 +1034,6 @@ void appendToClipboard(int p, ^/char formatText, ^&.Var vars) | ||
1044 | 1034 | `yvel = 0.0; |
1045 | 1035 | `yaccel = 0.0/0.0; |
1046 | 1036 | `hitid = -1; |
1047 | - `mindistx = 0.0/0.0; | |
1048 | - `maxdistx = 0.0/0.0; | |
1049 | - `mindisty = 0.0/0.0; | |
1050 | - `maxdisty = 0.0/0.0; | |
1051 | - `snapx = 0.0/0.0; | |
1052 | - `snapy = 0.0/0.0; | |
1053 | - `snapf = 1; | |
1054 | - `snapfx = false; | |
1055 | - `snapfy = false; | |
1056 | - `snapt = 0; | |
1057 | 1037 | `fall.clear(); |
1058 | 1038 | `player = -1; |
1059 | 1039 | `fallf = false; |
@@ -1224,13 +1204,6 @@ void appendToClipboard(int p, ^/char formatText, ^&.Var vars) | ||
1224 | 1204 | `hb.fall = hit.fall; |
1225 | 1205 | `fallTime = 0; |
1226 | 1206 | `hb.yaccel = hit.yaccel; |
1227 | - `hb.mindistx = hit.mindistx; | |
1228 | - `hb.maxdistx = hit.maxdistx; | |
1229 | - `hb.mindisty = hit.mindisty; | |
1230 | - `hb.maxdisty = hit.maxdisty; | |
1231 | - `hb.snapx = hit.snapx; | |
1232 | - `hb.snapy = hit.snapy; | |
1233 | - `hb.snapt = hit.snapt; | |
1234 | 1207 | if(hit.forcenofall) fall = false; |
1235 | 1208 | `hb.groundtype = (int)hit.ground_type; |
1236 | 1209 | `hb.airtype = (int)hit.air_type; |
@@ -3042,56 +3015,6 @@ public &Char | ||
3042 | 3015 | `stVal.mov = .MovTy::H; |
3043 | 3016 | if(`sysivar[.iHITPAUSETIME] > 0) `stVal.clearWw(); |
3044 | 3017 | `sysivar[.iHITPAUSETIME] = 0; |
3045 | - double snapx = 0.0/0.0; | |
3046 | - double snapy = 0.0/0.0; | |
3047 | - if(!.m.isnan(`stVal.hb.mindistx)) branch{ | |
3048 | - cond `stVal.hb.snapf < 0: | |
3049 | - if(`sysfvar[.fX] > (`stVal.hb.snapx - `stVal.hb.mindistx)){ | |
3050 | - snapx = `stVal.hb.snapx - `stVal.hb.mindistx; | |
3051 | - } | |
3052 | - else: | |
3053 | - if(`sysfvar[.fX] < (`stVal.hb.snapx + `stVal.hb.mindistx)){ | |
3054 | - snapx = `stVal.hb.snapx + `stVal.hb.mindistx; | |
3055 | - } | |
3056 | - } | |
3057 | - if(!.m.isnan(`stVal.hb.maxdistx)) branch{ | |
3058 | - cond `stVal.hb.snapf < 0: | |
3059 | - if(`sysfvar[.fX] < (`stVal.hb.snapx - `stVal.hb.maxdistx)){ | |
3060 | - snapx = `stVal.hb.snapx - `stVal.hb.maxdistx; | |
3061 | - } | |
3062 | - else: | |
3063 | - if(`sysfvar[.fX] > (`stVal.hb.snapx + `stVal.hb.maxdistx)){ | |
3064 | - snapx = `stVal.hb.snapx + `stVal.hb.maxdistx; | |
3065 | - } | |
3066 | - } | |
3067 | - if(!`stVal.hb.guarded || `stVal.typ == .StTy::A){ | |
3068 | - if( | |
3069 | - !.m.isnan(`stVal.hb.mindisty) | |
3070 | - && `sysfvar[.fY] < (`stVal.hb.snapy + `stVal.hb.mindisty)) | |
3071 | - { | |
3072 | - snapy = `stVal.hb.snapy + `stVal.hb.mindisty; | |
3073 | - } | |
3074 | - if( | |
3075 | - !.m.isnan(`stVal.hb.maxdisty) | |
3076 | - && `sysfvar[.fY] > (`stVal.hb.snapy + `stVal.hb.maxdisty)) | |
3077 | - { | |
3078 | - snapy = `stVal.hb.snapy + `stVal.hb.maxdisty; | |
3079 | - } | |
3080 | - } | |
3081 | - if(!.m.isnan(snapx)) `stVal.hb.xoff = snapx - `sysfvar[.fX]; | |
3082 | - if(!.m.isnan(snapy)) `stVal.hb.yoff = snapy - `sysfvar[.fY]; | |
3083 | - ^`self c; | |
3084 | - if(#`stVal.hb.by > 0 && #(c = .players.get(`stVal.hb.by[-1].id)) > 0){ | |
3085 | - if(`stVal.hb.snapt != 0){ | |
3086 | - `setBindToId(c<>=); | |
3087 | - `setBindTime(`stVal.hb.snapt); | |
3088 | - `sysivar[.iBINDFACING] = 0; | |
3089 | - `sysfvar[.fBINDPOSX] = | |
3090 | - `stVal.hb.snapfx ? `stVal.hb.mindistx : 0.0/0.0; | |
3091 | - `sysfvar[.fBINDPOSY] = | |
3092 | - `stVal.hb.snapfy ? `stVal.hb.mindisty : 0.0/0.0; | |
3093 | - } | |
3094 | - } | |
3095 | 3018 | if(`ho >= 0 && `stVal.ho[`ho].forceair != 0) `stVal.typ = .StTy::A; |
3096 | 3019 | branch{ |
3097 | 3020 | int pn = `stVal.hb.p2getp1state ? `stVal.hb.player : `playerno; |
@@ -6036,16 +5959,66 @@ public void PlayerList!&Char?::clsn(&.Char pyr=, bool pro) | ||
6036 | 5959 | `pyr.stVal.setHb( |
6037 | 5960 | hit=, guard, `pyr.stVal.mov == .MovTy::H || `pyr.ls(.lsGETHIT), |
6038 | 5961 | absdamage=); |
6039 | - if(!.m.isnan(hit.snapx)) `pyr.stVal.hb.snapfx = true; | |
6040 | - if( | |
6041 | - !.m.isnan(hit.snapy) | |
6042 | - && (!`pyr.stVal.hb.guarded || `pyr.stVal.typ == .StTy::A)) | |
6043 | 5962 | { |
6044 | - `pyr.stVal.hb.snapfy = true; | |
5963 | + int byf = pro != 0 ? pro : by.facing; | |
5964 | + if(pro == 0 && hitting == 1) branch{ | |
5965 | + cond hit.p1getp2facing != 0: | |
5966 | + byf = `pyr.facing*(hit.p1getp2facing < 0 ? (int)-1 : 1); | |
5967 | + cond hit.p1facing < 0: | |
5968 | + byf *= -1; | |
5969 | + } | |
5970 | + bool snapfx = !.m.isnan(hit.snapx); | |
5971 | + bool snapfy = | |
5972 | + !.m.isnan(hit.snapy) | |
5973 | + && (!`pyr.stVal.hb.guarded || `pyr.stVal.typ == .StTy::A); | |
5974 | + float byx = by.sysfvar[.fX] + (float)(pro != 0) * x; | |
5975 | + float byy = by.sysfvar[.fY] + (float)(pro != 0) * y; | |
5976 | + float snapx = 0.0/0.0; | |
5977 | + float snapy = 0.0/0.0; | |
5978 | + if(!.m.isnan(hit.mindistx)) branch{ | |
5979 | + cond byf < 0: | |
5980 | + if(`pyr.sysfvar[.fX] > (byx - hit.mindistx)){ | |
5981 | + snapx = byx - hit.mindistx; | |
5982 | + } | |
5983 | + else: | |
5984 | + if(`pyr.sysfvar[.fX] < (byx + hit.mindistx)){ | |
5985 | + snapx = byx + hit.mindistx; | |
5986 | + } | |
5987 | + } | |
5988 | + if(!.m.isnan(hit.maxdistx)) branch{ | |
5989 | + cond byf < 0: | |
5990 | + if(`pyr.sysfvar[.fX] < (byx - hit.maxdistx)){ | |
5991 | + snapx = byx - hit.maxdistx; | |
5992 | + } | |
5993 | + else: | |
5994 | + if(`pyr.sysfvar[.fX] > (byx + hit.maxdistx)){ | |
5995 | + snapx = byx + hit.maxdistx; | |
5996 | + } | |
5997 | + } | |
5998 | + if(hitting == 1 || `pyr.stVal.typ == .StTy::A){ | |
5999 | + if( | |
6000 | + !.m.isnan(hit.mindisty) | |
6001 | + && `pyr.sysfvar[.fY] < (byy + hit.mindisty)) | |
6002 | + { | |
6003 | + snapy = byy + hit.mindisty; | |
6004 | + } | |
6005 | + if( | |
6006 | + !.m.isnan(hit.maxdisty) | |
6007 | + && `pyr.sysfvar[.fY] > (byy + hit.maxdisty)) | |
6008 | + { | |
6009 | + snapy = byy + hit.maxdisty; | |
6010 | + } | |
6011 | + } | |
6012 | + if(!.m.isnan(snapx)) `pyr.stVal.hb.xoff += snapx - `pyr.sysfvar[.fX]; | |
6013 | + if(!.m.isnan(snapy)) `pyr.stVal.hb.yoff = snapy - `pyr.sysfvar[.fY]; | |
6014 | + if(hit.snapt != 0){ | |
6015 | + `pyr.setBindToId(by=); | |
6016 | + `pyr.setBindTime(hit.snapt); | |
6017 | + `pyr.sysivar[.iBINDFACING] = 0; | |
6018 | + `pyr.sysfvar[.fBINDPOSX] = snapfx ? hit.mindistx : 0.0/0.0; | |
6019 | + `pyr.sysfvar[.fBINDPOSY] = snapfy ? hit.mindisty : 0.0/0.0; | |
6020 | + } | |
6045 | 6021 | } |
6046 | - `pyr.stVal.hb.snapx = by.sysfvar[.fX] + (float)(pro != 0) * x; | |
6047 | - `pyr.stVal.hb.snapf = pro != 0 ? pro : by.facing; | |
6048 | - `pyr.stVal.hb.snapy = by.sysfvar[.fY] + (float)(pro != 0) * y; | |
6049 | 6022 | else: |
6050 | 6023 | absdamage = hitting == 1 ? hit.hitdamage : hit.guarddamage; |
6051 | 6024 | } |
@@ -6256,7 +6229,6 @@ public void PlayerList!&Char?::clsn(&.Char pyr=, bool pro) | ||
6256 | 6229 | `pyr.stVal.hb.airtype -= `pyr.stVal.hb.airtype*2 - 3; |
6257 | 6230 | } |
6258 | 6231 | } |
6259 | - if(pro == 0 && by.facing * by.p1facing < 0) `pyr.stVal.hb.snapf *= -1; | |
6260 | 6232 | } |
6261 | 6233 | ret true; |
6262 | 6234 | } |
@@ -533,9 +533,9 @@ void gethitvar(&.lua.State L=, int re=) | ||
533 | 533 | cond .s.equ("recovertime", ghv): |
534 | 534 | n = (double).cwc~sysivar[.chr.iRECOVERTIME]; |
535 | 535 | cond .s.equ("xoff", ghv): |
536 | - n = (double).cwc~stVal.hb.snapx; | |
536 | + n = (double).cwc~stVal.hb.xoff; | |
537 | 537 | cond .s.equ("yoff", ghv): |
538 | - n = (double).cwc~stVal.hb.snapy; | |
538 | + n = (double).cwc~stVal.hb.yoff; | |
539 | 539 | cond .s.equ("xvel", ghv): |
540 | 540 | n = .cwc~trHitXvel(); |
541 | 541 | cond .s.equ("yvel", ghv): |