void c_meta::box_coll_get(box_box *box) { frame_box *bx = get_pframe()->box_coll; if (dir == 1) { box->x1 = x + bx->x1; box->x2 = x + bx->x2; } else { box->x1 = x - bx->x2; box->x2 = x - bx->x1; } box->y1 = bx->y1 - y; box->y2 = bx->y2 - y; }
double c_meta::sub_4636B0() { float dmg = 0; char_c * chr = chrt; char_c * chr2 = chrt_changeable; char_c * enm = enemy; dmg = chr->field_530 * enm->field_534 * chr2->combo_rate; if ( enm->field_1B4 >= 0 ) { if ( enm->max_health > enm->field_1B4 ) dmg *= (enm->field_1B4 / enm->max_health * 0.3 + 0.7); } else { dmg *= 0.7; } if ( field_18C >= 0 && field_18C < 32 ) dmg *= chr->skills_1[field_18C] / 10.0 + 1.0; uint32_t aflgs = get_pframe()->aflags; if ( aflgs & AF_UNK1000 ) dmg *= chr->field_544; if ( aflgs & AF_UNK800 ) dmg *= chr->field_548; if ( chr2->correction & 1 ) dmg *= 0.8; if ( chr2->correction & 2 ) dmg *= 0.8; if ( chr2->correction & 4 ) dmg *= 0.8; if ( chr2->correction & 8 ) dmg *= 0.85; if ( chr2->correction & 0x10 ) dmg *= 0.925; return dmg; }
void c_meta::scn_char_ss2() { field_1B4 = health; field_1B8 = field_190; field_1BC = field_194; field_1C8 = get_seq(); field_1CA = dir; char_frame *frm = get_pframe(); atk_box_cnt = frm->box_atk.size(); hit_box_cnt = frm->box_hit.size(); for(int32_t i=0; i<atk_box_cnt; i++) { if (frm->box_unk_atk[i] != NULL || frm->fflags & FF_UNK400000) atk_area_of[i] = &atk_area_2o[5 + i]; else atk_area_of[i] = NULL; } for(int32_t i=0; i<hit_box_cnt; i++) { if (frm->fflags & FF_UNK800000) hit_area_flags[i] = &atk_area_2o[10 + i]; else hit_area_flags[i] = NULL; } for(int32_t i=0; i<atk_box_cnt; i++) { if (frm->box_unk_atk[i] != NULL) { frame_box_fullflip(&frm->box_atk[i],&atk_area_2o[i]); frame_box *bx = atk_area_of[i]; if (dir < 0) { bx->x1 = frm->box_unk_atk[i]->x2; bx->y1 = -frm->box_unk_atk[i]->y2; bx->x2 = frm->box_unk_atk[i]->x1; bx->y2 = -frm->box_unk_atk[i]->y1; } else { bx->x1 = frm->box_unk_atk[i]->x1; bx->y1 = frm->box_unk_atk[i]->y1; bx->x2 = frm->box_unk_atk[i]->x2; bx->y2 = frm->box_unk_atk[i]->y2; } } else if (frm->fflags & FF_UNK400000) { frame_box tmp,tmp2; frame_box_move_rotate(&frm->box_atk[i],angZ,x_off,-y_off,&tmp,&tmp2); frame_box_fullflip(&tmp,&atk_area_2o[i]); frame_box *bx = atk_area_of[i]; if ( dir < 0 ) { bx->x1 = tmp2.x2; bx->y1 = -tmp2.y2; bx->x2 = tmp2.x1; bx->y2 = -tmp2.y1; } else { bx->x1 = tmp2.x1; bx->y1 = tmp2.y1; bx->x2 = tmp2.x2; bx->y2 = tmp2.y2; } } else { frame_box_flip(&frm->box_atk[i],&atk_area_2o[i]); } } if ( frm->fflags & FF_UNK800000 ) { for(int32_t i=0; i<hit_box_cnt; i++) { frame_box tmp,tmp2; frame_box_move_rotate(&frm->box_hit[i],angZ,x_off,-y_off,&tmp,&tmp2); frame_box_fullflip(&tmp,&hit_area_2o[i]); frame_box *bx = hit_area_flags[i]; if ( dir < 0 ) { bx->x1 = tmp2.x2; bx->y1 = -tmp2.y2; bx->x2 = tmp2.x1; bx->y2 = -tmp2.y1; } else { bx->x1 = tmp2.x1; bx->y1 = tmp2.y1; bx->x2 = tmp2.x2; bx->y2 = tmp2.y2; } } } else { for(int32_t i=0; i<hit_box_cnt; i++) { frame_box_flip(&frm->box_hit[i],&hit_area_2o[i]); } } if ( cust_box ) { if (cust_box->angle != 0) { frame_box tmp,tmp2; atk_area_of[atk_box_cnt] = &atk_area_2o[5 + atk_box_cnt]; frame_box_move_rotate(&cust_box->box, cust_box->angle, cust_box->c_x, cust_box->c_y, &tmp,&tmp2); frame_box_fullflip(&tmp,&atk_area_2o[atk_box_cnt]); frame_box *bx = atk_area_of[atk_box_cnt]; if ( dir < 0 ) { bx->x1 = tmp2.x2; bx->y1 = -tmp2.y2; bx->x2 = tmp2.x1; bx->y2 = -tmp2.y1; } else { bx->x1 = tmp2.x1; bx->y1 = tmp2.y1; bx->x2 = tmp2.x2; bx->y2 = tmp2.y2; } } else { atk_area_of[atk_box_cnt] = NULL; frame_box_flip(&cust_box->box ,&atk_area_2o[atk_box_cnt]); } if ( frm->fflags & FF_ATK_AS_HIT ) { hit_area_2o[hit_box_cnt] = atk_area_2o[atk_box_cnt]; hit_area_flags[hit_box_cnt] = atk_area_of[atk_box_cnt]; hit_box_cnt++; } atk_box_cnt++; } if (frm->box_coll) { pcoll_box = &atk_area_2o[15]; frame_box_flip(frm->box_coll, &atk_area_2o[15]); } else pcoll_box = NULL; }
float c_meta::sub_464270() { return get_pframe()->health_smval * sub_4636B0(); }
int32_t c_meta::sub_464240() { return (sub_4636B0() * get_pframe()->damage); }
unsigned int aesccmp_decrypt(struct rtl8192cd_priv *priv, struct rx_frinfo *pfrinfo) { UINT8 *ttkey = NULL; UINT32 hdrlen, keylen = 0; UINT8 a4_exists; UINT8 qc_exists; UINT8 *sa = pfrinfo->sa; UINT8 *pframe = get_pframe(pfrinfo); UINT8 to_fr_ds = pfrinfo->to_fr_ds; struct stat_info *pstat = NULL; if (to_fr_ds != 0x03) { hdrlen = WLAN_HDR_A3_LEN; a4_exists = 0; } else { hdrlen = WLAN_HDR_A4_LEN; a4_exists = 1; } if (is_qos_data(pframe)) { qc_exists = 1; hdrlen += 2; } else qc_exists = 0; if (OPMODE & WIFI_AP_STATE) { #if defined(WDS) || defined(CONFIG_RTK_MESH) if (to_fr_ds == 3) pstat = get_stainfo (priv, GetAddr2Ptr(pframe)); else #endif #ifdef A4_STA if (to_fr_ds == 3) pstat = get_stainfo (priv, GetAddr2Ptr(pframe)); else #endif pstat = get_stainfo (priv, sa); { if (pstat == NULL) { DEBUG_ERR("AES Rx fails! sa=%02X%02X%02X%02X%02X%02X\n", sa[0], sa[1], sa[2], sa[3], sa[4], sa[5]); return FALSE; } keylen = GET_UNICAST_ENCRYP_KEYLEN; ttkey = GET_UNICAST_ENCRYP_KEY; } } #ifdef CLIENT_MODE else if (OPMODE & WIFI_STATION_STATE) { if (IS_MCAST(pfrinfo->da)) { keylen = GET_GROUP_ENCRYP_KEYLEN; ttkey = GET_GROUP_ENCRYP_KEY; } else { pstat = get_stainfo(priv, BSSID); if (pstat == NULL) { DEBUG_ERR("rx aes pstat == NULL\n"); return FALSE; } keylen = GET_UNICAST_ENCRYP_KEYLEN; ttkey = GET_UNICAST_ENCRYP_KEY; } } else if (OPMODE & WIFI_ADHOC_STATE) { keylen = GET_GROUP_ENCRYP_KEYLEN; ttkey = GET_GROUP_ENCRYP_KEY; } #endif if (keylen == 0) { DEBUG_ERR("no descrypt key for AES due to keylen=0\n"); return FALSE; } aes_rx(ttkey, qc_exists, a4_exists, pframe, hdrlen, pfrinfo->pktlen-hdrlen-8); return TRUE; }